react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

useOverlay: IMEs escape key behavior not taken into account

Open rktyt opened this issue 1 year ago โ€ข 0 comments

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.

  1. Open OS keyboard settings
  2. Add Chinese Pinyin - Simplified
  3. Type "ni", a set of suggestions should appear
  4. Press Tab 3x
  5. Press Escape and see the state of the dialog

Version

[email protected]

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

rktyt avatar Feb 22 '24 03:02 rktyt