question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Firefox does not fire `beforeinput` events

See original GitHub issue

Firefox 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!)

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

HTMLElement: beforeinput event - Web APIs | MDN
The DOM beforeinput event fires when the value of an <input> , or <textarea> element is about to be modified. The event also...
Read more >
1305387 - No "input" event should be fired immediately after ...
Firefox/Edge behavior does not require compositionend events since web apps can ignore only input events whose isComposing is true.
Read more >
1024350 - <select> does not fire input event - Bugzilla@Mozilla
The input event fires whenever the user has modified the data of the control. The change event fires when the value is committed,...
Read more >
970802 - [UI Events][Input Events] implement beforeinput event
Where should I look in our code to fire a beforeinput event on user actions? ... (We should NOT dispatch beforeinput for execCommand()?...
Read more >
998941 - [Input Events] Implement InputEvent.data and ...
Bug 998941 - part 1-3: Make TextEditor (only when not HTMLEditor instance) set ... Anyway, before implementing beforeinput event (bug 970802), we should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found