mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-03 17:56:26 +01:00
Additional key checks for browser compatibility (#2539)
Not all browsers recognize e.key === 'Escape'; some use 'Esc' and some only respond to the keyCode.
This commit is contained in:
parent
2e47fe3e1a
commit
c67d3c990b
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user