beforeinput event of React is not fired with MacOS accent popup selection
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
People
(Reporter: broomerjack, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(2 files)
Steps to reproduce:
- Using MacOS (v12.1), hold down the "a" key (or any standard english character with a latin accented variation) and wait for the accent popup to show up
- At this point the
keydown
andbeforeinput
events will have fired and the input should have the regular key inserted - Select one of the options from the accent menu
Simple CodeSandbox: https://codesandbox.io/s/react-typescript-forked-wh6no9?file=/src/App.tsx
Actual results:
Observe that the keydown
and input
events fire but not the beforeinput
event
Expected results:
I would have expected the beforeinput event to have fired
Reporter | ||
Comment 1•2 years ago
|
||
It's also worth mentioning that I would expect the beforeInput
and input
events to fire with the inputType of insertReplacementText
on selecting a character from the accent popup because it does replace the previous character.
Comment 2•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: UI Events & Focus Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Reporter | ||
Comment 4•2 years ago
|
||
This is an example of the MacOS popup
Reporter | ||
Comment 5•2 years ago
|
||
I am seeing the beforeInput
and input
events here however, I would have expected the inputType
to be insertReplacementText
.
Reporter | ||
Comment 6•2 years ago
|
||
Hi Hsin, maybe there was some confusion but this bug is MacOS specific because Windows doesn't have the same accent popup menu. I added screenshots above to hopefully clear things up a bit.
I don't reproduce this with raw DOM event. So this could be a bug of React (or the testcase).
Reporter | ||
Comment 8•2 years ago
|
||
Okay, I'll have to do some more digging into that on my end. What about the other issue:
It's also worth mentioning that I would expect the beforeInput and input events to fire with the inputType of insertReplacementText on selecting a character from the accent popup because it does replace the previous character.
Comment 9•2 years ago
|
||
(In reply to broomerjack from comment #8)
Okay, I'll have to do some more digging into that on my end. What about the other issue:
It's also worth mentioning that I would expect the beforeInput and input events to fire with the inputType of insertReplacementText on selecting a character from the accent popup because it does replace the previous character.
Masayuki, do you have thoughts for above?
Indeed, Chrome dispatches beforeinput
event with inputType="insertReplacementText"
in the case. However, I don't have much time to work on this bug at least in this month...
Updated•2 years ago
|
Oh, if I enable textInput
with the pref dom.events.textevent.enabled
, beforeinput
event also appears in the test case. So, it's a bug of React.
I think that insertReplacementText
should be handled in a new bug.
Description
•