blur on input elements when Esc pressed

This commit is contained in:
Shin'ya Ueoka 2017-09-25 20:57:01 +09:00
parent 6c01283973
commit 1a21e548d9

View file

@ -63,6 +63,9 @@ window.addEventListener('keypress', (e) => {
if (e.target instanceof HTMLInputElement ||
e.target instanceof HTMLTextAreaElement ||
e.target instanceof HTMLSelectElement) {
if (e.key === 'Escape' && e.target.blur) {
e.target.blur();
}
return;
}
browser.runtime.sendMessage({