From 1a21e548d924514e7b23add22e9ecd4fb071ea84 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 25 Sep 2017 20:57:01 +0900 Subject: blur on input elements when Esc pressed --- src/content/index.js | 3 +++ 1 file changed, 3 insertions(+) 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({ -- cgit v1.2.3