react-spectrum
react-spectrum copied to clipboard
useOverlay: IMEs escape key behavior not taken into account
Provide a general summary of the issue here
Related to #5904. This issue is about Escape.
Firefox's behavior is correct and other browsers' behavior is incorrect. As for Firefox, I have checked with Developer Edition.
๐ค Expected Behavior?
Pressing the Escape key does not close dialogs while operating with the IME. The Escape key cancels the selection of input candidates.
๐ฏ Current Behavior
Dialogs can be closed with the Escape key even while operating with the IME.
๐ Possible Solution
https://github.com/adobe/react-spectrum/blob/%40react-aria/overlays%403.21.0/packages/%40react-aria/overlays/src/useOverlay.ts#L115
- if (e.key === "Escape" && !isKeyboardDismissDisabled) {
+ if (e.key === "Escape" && !isKeyboardDismissDisabled && !e.nativeEvent.isComposing) {
Please someone open a PR. (I can't)
๐ฆ Context
No response
๐ฅ๏ธ Steps to Reproduce
Updated!
It may not be possible to confirm unless #5909 is reflected. Therefore the storybook of #5909 to check.
- Open OS keyboard settings
- Add Chinese Pinyin - Simplified
- Type "ni", a set of suggestions should appear
- Press Tab 3x
- Press Escape and see the state of the dialog
Version
What browsers are you seeing the problem on?
Chrome, Safari, Microsoft Edge
If other, please specify.
No response
What operating system are you using?
MacOS
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response