electron-userland / electron-spellchecker

Implement spellchecking, correctly
MIT License
238 stars 83 forks source link

Does not check existing content. #99

Open sorentycho opened 6 years ago

sorentycho commented 6 years ago

Electron: 1.7.9 electron-spellcheck: 1.1.2

When spellcheck is enabled on a document that either has contenteditable content existing already, or that will have such content programmatically added (e.g. loading a saved comment for editing), the spellchecker only marks misspelled words in paragraphs altered by the user directly.

It's possible to work around this by programmatically moving the selection through each word of the existing content and adding/deleting a character via execCommand, but this only works if in between each change one waits for at least a requestAnimationFrame so that the spellchecker can recheck that word, making it impracticably slow.

I'd be willing to believe this is actually an upstream bug in Chromium.

sorentycho commented 6 years ago

...especially because of https://github.com/mixmaxhq/electron-spell-check-provider/issues/11