aboutsummaryrefslogtreecommitdiff
path: root/src/content/index.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-09-25 20:57:01 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2017-09-25 20:57:01 +0900
commit1a21e548d924514e7b23add22e9ecd4fb071ea84 (patch)
treecd8731edaf3f432e166739cddd6a4112a5ca2083 /src/content/index.js
parent6c012839737b60442e582e08209f551536ca2e81 (diff)
blur on input elements when Esc pressed
Diffstat (limited to 'src/content/index.js')
-rw-r--r--src/content/index.js3
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({