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
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
keydownandbeforeinputevents 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•4 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•4 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•4 years ago
|
||
This is an example of the MacOS popup
| Reporter | ||
Comment 5•4 years ago
|
||
I am seeing the beforeInput and input events here however, I would have expected the inputType to be insertReplacementText.
| Reporter | ||
Comment 6•4 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.
Comment 7•4 years ago
|
||
I don't reproduce this with raw DOM event. So this could be a bug of React (or the testcase).
| Reporter | ||
Comment 8•4 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•4 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?
Comment 10•4 years ago
|
||
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•4 years ago
|
Comment 11•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.
Comment 12•8 months ago
|
||
At least, the test case looks like working fine right now. If you think the inputType is a bug of Gecko, feel free to file a new bug.
Description
•