Phenomenon
The beforeinput event, which is crucial for intercepting and modifying input before it’s committed to the DOM, is not supported in Safari. This makes it difficult to implement custom input handling that works across all browsers.
Reproduction example
- Create a contenteditable div.
- Add an event listener for the
beforeinputevent. - Type some text.
- Observe whether the
beforeinputevent fires.
Observed behavior
- In Safari on macOS, the
beforeinputevent does not fire. - Event listeners for
beforeinputare never called. - Alternative approaches must be used, but they are less reliable.
Expected behavior
- The
beforeinputevent should be supported in all modern browsers. - The event should fire before input is committed to the DOM.
- It should provide a way to prevent or modify the default input behavior.