@rc-component/portal 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/useEscKeyDown.js +1 -1
- package/lib/useEscKeyDown.js +1 -1
- package/package.json +1 -1
package/es/useEscKeyDown.js
CHANGED
|
@@ -6,7 +6,7 @@ export let stack = []; // export for testing
|
|
|
6
6
|
export default function useEscKeyDown(open, onEsc) {
|
|
7
7
|
const id = useId();
|
|
8
8
|
const handleEscKeyDown = useEvent(event => {
|
|
9
|
-
if (event.key === 'Escape') {
|
|
9
|
+
if (event.key === 'Escape' && !event.isComposing) {
|
|
10
10
|
const top = stack[stack.length - 1] === id;
|
|
11
11
|
onEsc?.({
|
|
12
12
|
top,
|
package/lib/useEscKeyDown.js
CHANGED
|
@@ -14,7 +14,7 @@ let stack = exports.stack = []; // export for testing
|
|
|
14
14
|
function useEscKeyDown(open, onEsc) {
|
|
15
15
|
const id = (0, _useId.default)();
|
|
16
16
|
const handleEscKeyDown = (0, _util.useEvent)(event => {
|
|
17
|
-
if (event.key === 'Escape') {
|
|
17
|
+
if (event.key === 'Escape' && !event.isComposing) {
|
|
18
18
|
const top = stack[stack.length - 1] === id;
|
|
19
19
|
onEsc?.({
|
|
20
20
|
top,
|