Skip to content
Snippets Groups Projects
Commit c67d3c99 authored by Noëlle Anthony's avatar Noëlle Anthony Committed by Matt Jankowski
Browse files

Additional key checks for browser compatibility (#2539)

Not all browsers recognize e.key === 'Escape'; some use 'Esc' and some only respond to the keyCode.
parent 2e47fe3e
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,8 @@ class ModalRoot extends React.PureComponent {
}
handleKeyUp (e) {
if (e.key === 'Escape' && !!this.props.type) {
if ((e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27)
&& !!this.props.type) {
this.props.onClose();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment