From c69fdbb14a3eb60d5cfd4f6d1816732dbc2b9163 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 26 Feb 2018 21:03:51 +0900 Subject: [PATCH] Cancel key input by --- src/content/components/common/input.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/content/components/common/input.js b/src/content/components/common/input.js index 22b0a91..eefaf10 100644 --- a/src/content/components/common/input.js +++ b/src/content/components/common/input.js @@ -1,6 +1,10 @@ import * as dom from 'shared/utils/dom'; import * as keys from 'shared/utils/keys'; +const cancelKey = (e) => { + return e.key === 'Escape' || e.key === '[' && e.ctrlKey; +}; + export default class InputComponent { constructor(target) { this.pressed = {}; @@ -37,7 +41,7 @@ export default class InputComponent { capture(e) { if (this.fromInput(e)) { - if (e.key === 'Escape' && e.target.blur) { + if (cancelKey(e) && e.target.blur) { e.target.blur(); } return;