diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-25 20:57:01 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-25 20:57:01 +0900 |
commit | 1a21e548d924514e7b23add22e9ecd4fb071ea84 (patch) | |
tree | cd8731edaf3f432e166739cddd6a4112a5ca2083 | |
parent | 6c012839737b60442e582e08209f551536ca2e81 (diff) |
blur on input elements when Esc pressed
-rw-r--r-- | src/content/index.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/content/index.js b/src/content/index.js index 7ce41c1..80acd2d 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -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({ |