Browse Source

docs: Update breaking changes on webFrame.setSpellCheckProvider (#17915)

* doc: Update breaking changes on webFrame.setSpellCheckProvider

* doc: fix example

* doc: lint: extra semicolon

* Update docs/api/breaking-changes.md

Co-Authored-By: magne4000 <[email protected]>
Joël Charles 5 years ago
parent
commit
fd9e031f0d
1 changed files with 17 additions and 0 deletions
  1. 17 0
      docs/api/breaking-changes.md

+ 17 - 0
docs/api/breaking-changes.md

@@ -200,6 +200,23 @@ webFrame.setIsolatedWorldInfo(
   })
 ```
 
+## `webFrame.setSpellCheckProvider`
+The `spellCheck` callback is now asynchronous, and `autoCorrectWord` parameter has been removed.
+```js
+// Deprecated
+webFrame.setSpellCheckProvider('en-US', true, {
+  spellCheck: (text) => {
+    return !spellchecker.isMisspelled(text)
+  }
+})
+// Replace with
+webFrame.setSpellCheckProvider('en-US', {
+  spellCheck: (words, callback) => {
+    callback(words.filter(text => spellchecker.isMisspelled(text)))
+  }
+})
+```
+
 ## Planned Breaking API Changes (4.0)
 
 The following list includes the breaking API changes made in Electron 4.0.