fix esacape key on keyable overlay

This commit is contained in:
Will Hanlen 2024-06-22 16:35:04 -04:00
parent 14e06e9186
commit c3327132ff

View File

@ -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();
} }