Firefox does not fire `beforeinput` events
See original GitHub issueFirefox does not currently support the beforeinput
event, which Slate uses under the covers to be notified whenever the user triggers an input into the editor (inserts, deletes, cuts, pastes, drops, etc.). These beforeinput
events are cancellable and we use them to then do the Slate-equivalent of whatever the event was.
Right now we hack around this for Firefox and handle some of the common input cases. However, there’s only so much we can do. And input events like formatBold
, or insertFromComposition
are hard to polyfill. (There might be ways to improve our existing ones, if you see them please PR!)
This is also the reason we disable autoCorrect
and spellCheck
in Firefox on the contenteditable
element, since we have no easy way of determining when those changes occur.
Here are the bug reports… (please vote for and follow them!)
- https://bugzilla.mozilla.org/show_bug.cgi?id=970802
- https://bugzilla.mozilla.org/show_bug.cgi?id=1305387
- https://bugzilla.mozilla.org/show_bug.cgi?id=1449831
Once these are supported Firefox will get improved editing support (autocorrect, spellcheck, IME composition, B/U/I toolbars, etc.). And we’ll be able to reduce bundle size for everyone by removing the current Firefox-specific hacks.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7
Top GitHub Comments
https://bugzilla.mozilla.org/show_bug.cgi?id=970802 and https://bugzilla.mozilla.org/show_bug.cgi?id=1449831 have been marked as fixed 👍
+1 I force “true” here https://github.com/ianstormtaylor/slate/blob/f4ee75d13d219214fd12c1b10448098f4c070b77/packages/slate-react/src/components/editable.tsx#L41 and spellcheck work perfectily on firefox 76.