logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: c67d3c990b29bd8e6ee47a2b83d7dad0b5788c2e
parent: 2e47fe3e1a8087e1beda15b145aa9ce88fff1229
Author: Noƫlle Anthony <noelle.d.anthony@gmail.com>
Date:   Sun, 30 Apr 2017 09:12:14 -0400

Additional key checks for browser compatibility (#2539)

Not all browsers recognize e.key === 'Escape'; some use 'Esc' and some only respond to the keyCode.

Diffstat:

Mapp/assets/javascripts/components/features/ui/components/modal_root.jsx3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/app/assets/javascripts/components/features/ui/components/modal_root.jsx b/app/assets/javascripts/components/features/ui/components/modal_root.jsx @@ -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(); } }