This website works better with JavaScript.
Home
Explore
Help
Sign In
closed-social
/
mastodon
Watch
3
Star
0
Fork
2
Code
Issues
5
Pull Requests
0
Projects
0
Releases
3
Wiki
Activity
Browse Source
Additional key checks for browser compatibility (
#2539
)
Not all browsers recognize e.key === 'Escape'; some use 'Esc' and some only respond to the keyCode.
closed-social-glitch-2
Noëlle Anthony
7 years ago
committed by
Matt Jankowski
parent
2e47fe3e1a
commit
c67d3c990b
1 changed files
with
2 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-1
app/assets/javascripts/components/features/ui/components/modal_root.jsx
+ 2
- 1
app/assets/javascripts/components/features/ui/components/modal_root.jsx
View File
@ -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
(
)
;
}
}
Write
Preview
Loading…
Cancel
Save