Running spell checker on a contenteditable div

I am creating an editor without relying on contenteditable to get clean controlled output. Therefore, I am catching all keyboard and mouse events by creating the model and creating the DOM view from this model.

Since I need a spell checker I have activated the contenteditable on the divs in my opinion. The user does not interact with him because I am catching all the events.

The problem is that the spell check only gets activated when the user enters into the contenteditable div, which in my case only happens when I right click on the text (because I don't understand it). I found a question that simply says that we shouldn't expect the spell check to be active at the start, but in my case, even when the user enters, the spell check doesn't happen (because he doesn't enter content, m building).

HTML spell check in contenteditable div not working after range

So, is there a way I can trigger an event that makes the browser think the user is interacting with a contenteditable?

Update: Chrome only, in Firefox, spell check works even without user-triggered events.

+3


source to share


1 answer


Maybe it will work. It looks like there is an HTML attribute for this. https://www.w3schools.com/tags/att_global_spellcheck.asp



0


source







All Articles