Inconsistent crossbrowser onBeforeInput paste event behavior #21742
Labels
Component: DOM
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
Type: Bug
React version: 17.0.2
In Chrome, pasting triggers
onPaste
andonBeforeInput
, with thenativeEvent
sClipboardEvent
andTextEvent
respectively.In Firefox, pasting only triggers
onPaste
withnativeEvent
paste
.If I'm not mistaken, this seems to be the code responsible for not triggering
onBeforeInput
on nativepaste
events:react/packages/react-dom/src/events/plugins/BeforeInputEventPlugin.js
Lines 328 to 331 in 27c9c95
React version: 17.0.2 and 18.0.0
17.0.2
https://codesandbox.io/s/condescending-cerf-e1qt9?file=/src/App.js
18.0.0
https://codesandbox.io/s/sparkling-sun-fylti?file=/src/App.js
The text was updated successfully, but these errors were encountered: