ignore events from contenteditable

This commit is contained in:
Shin'ya Ueoka 2017-10-12 20:42:55 +09:00
parent f2a42c50d9
commit 10beccfab2

View file

@ -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() === '');
}
}