electron / electron

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS
https://electronjs.org
MIT License
113.73k stars 15.31k forks source link

No way to support "Check Spelling While Typing" setting by toggling spellchecker webpreference #22143

Closed jwheare closed 4 years ago

jwheare commented 4 years ago

Preflight Checklist

Issue Details

With the built in spellchecker landed in 8.0.0, there is no way to toggle spellchecking behaviour without recreating a BrowserWindow, since it's only exposed as a boolean on webPreferences.

This makes it impossible to implement the standard "Check Spelling While Typing" menu item on macOS.

Please provide a runtime toggle for this.

thomasdao commented 4 years ago

I can work around this issue by setting spellcheck="false" to the DOM element that doesn't require spellcheck.

MarshallOfSound commented 4 years ago

As @thomasdao suggested, with the new Spellchecker Electron is aligning more with how Chromium works and there is already a webstandard way for disabling the spellchecker on DOM elements. You should be using that 👍