From 10beccfab2361e97a25628e017662dee70c079a9 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Thu, 12 Oct 2017 20:42:55 +0900 Subject: [PATCH] ignore events from contenteditable --- src/content/components/content-input.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/content/components/content-input.js b/src/content/components/content-input.js index 0ba4bcb..3e70bbb 100644 --- a/src/content/components/content-input.js +++ b/src/content/components/content-input.js @@ -63,6 +63,10 @@ export default class ContentInputComponent { fromInput(e) { return e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || - e.target instanceof HTMLSelectElement; + e.target instanceof HTMLSelectElement || + e.target instanceof HTMLElement && + e.target.hasAttribute('contenteditable') && ( + e.target.getAttribute('contenteditable').toLowerCase() === 'true' || + e.target.getAttribute('contenteditable').toLowerCase() === ''); } }