Fix “enter” key closing modals (#40757)

This commit is contained in:
Claire
2026-09-30 07:58:48 +00:00
committed by GitHub
parent 083ac4bef6
commit e5ec4643cb

View File

@@ -54,7 +54,7 @@ class ModalRoot extends PureComponent {
e.stopPropagation();
e.preventDefault();
}
} else if (key === 'enter' && !e.defaultPrevented && !!this.props.children) {
} else if (key === 'escape' && !e.defaultPrevented && !!this.props.children) {
this.props.onClose();
}
};