dom helper

This commit is contained in:
Shin'ya Ueoka 2017-10-23 20:10:05 +09:00
parent ccc81312a1
commit a57cdbd5b5
3 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,5 @@
import * as dom from 'shared/utils/dom';
const modifierdKeyName = (name) => {
if (name.length === 1) {
return name.toUpperCase();
@ -78,12 +80,12 @@ export default class InputComponent {
}
fromInput(e) {
if (!e.target) {
return false;
}
return e.target instanceof HTMLInputElement ||
e.target instanceof HTMLTextAreaElement ||
e.target instanceof HTMLSelectElement ||
e.target instanceof HTMLElement &&
e.target.hasAttribute('contenteditable') && (
e.target.getAttribute('contenteditable').toLowerCase() === 'true' ||
e.target.getAttribute('contenteditable').toLowerCase() === '');
dom.isContentEditable(e.target);
}
}