mirror of
https://github.com/urbit/shrub.git
synced 2024-11-27 18:34:48 +03:00
fix esacape key on keyable overlay
This commit is contained in:
parent
14e06e9186
commit
c3327132ff
@ -258,14 +258,14 @@
|
|||||||
function handleKey(e) {
|
function handleKey(e) {
|
||||||
let focused = document.activeElement;
|
let focused = document.activeElement;
|
||||||
let textarea = ['TEXTAREA'].includes(focused.nodeName)
|
let textarea = ['TEXTAREA'].includes(focused.nodeName)
|
||||||
let textinput = ['text', 'number', 'email', 'password'].includes(focused.getAttribute('type'));
|
let textinput = ['text', 'number', 'email', 'password'].includes(focused.type);
|
||||||
if (textarea || textinput) {
|
if (textarea || textinput) {
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
document.activeElement.blur();
|
document.activeElement.blur();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (e.key === 'Escape') {
|
else if (e.key === 'Escape') {
|
||||||
closeEye();
|
closeEye();
|
||||||
document.activeElement.blur();
|
document.activeElement.blur();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user