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 <joel.charles91@gmail.com>
This commit is contained in:
parent
0ee2f8a64a
commit
fd9e031f0d
1 changed files with 17 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue