- 
                Notifications
    You must be signed in to change notification settings 
- Fork 49.7k
Closed as not planned
Labels
Component: DOMResolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
React version: 17.0.1
Steps To Reproduce
- Add an onChangehandler to aninput[type=text]field, logging theevent.target.value
- Write a letter in the input (see that it fires an event)
- Select all text
- Type a new letter, thus replacing the previous letter
- This will trigger two events on some device setups, one with blank input, and one with the new letter.
Link to code example: https://codesandbox.io/s/react-input-event-twice-4dh59
The current behavior
On some devices the replacement of a selection fires twice, first with empty input and second with the typed letter.
The expected behavior
Only one input event should be fired, with the new letter.
Devices/browsers tested:
Two events (bug):
- OnePlus 5, Android OxygenOS 9.0.9, Chrome 87.0.4280.101
- OnePlus 3T, Android OxygenOS 9.0.6, Chrome 87.0.4280.101
One events (working as intended):
- MacOS 10.14.6, Firefox 83.0
- MacOS 10.14.6, Chrome 87.0.4280.88
- iPhone X, iOS 14.2, Chrome 87.0.4280.77
- Pixel 2, Android 8.0.0, Chrome 87.0.4280.101 (however this test person experienced the bug earlier, but might have been an in app browser somewhere)
Related:
- IE10 triggers onChange twice when replacing a text selection #8531 IE10 triggers onChange twice when replacing a text selection
Metadata
Metadata
Assignees
Labels
Component: DOMResolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug

