Il sito funziona meglio con JavaScript.
Home
Esplora
Aiuto
Accedi
abunchtell
/
mastodon
Segui
1
Vota
0
Forka
0
Codice
Problemi
0
Attività
Sfoglia il codice sorgente
Additional key checks for browser compatibility (
#2539
)
Not all browsers recognize e.key === 'Escape'; some use 'Esc' and some only respond to the keyCode.
master
Noëlle Anthony
7 anni fa
committed by
Matt Jankowski
parent
2e47fe3e1a
commit
c67d3c990b
1 ha cambiato i file
con
2 aggiunte
e
1 eliminazioni
Visualizzazione separata
Opzioni Diff
Mostra statistiche
Scarica il file Patch
Scarica il file Diff
+2
-1
app/assets/javascripts/components/features/ui/components/modal_root.jsx
+ 2
- 1
app/assets/javascripts/components/features/ui/components/modal_root.jsx
Vedi 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();
}
}
Scrivi
Anteprima
Caricamento…
Annulla
Salva