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

8
src/shared/utils/dom.js Normal file
View file

@ -0,0 +1,8 @@
const isContentEditable = (element) => {
return element.hasAttribute('contenteditable') && (
element.getAttribute('contenteditable').toLowerCase() === 'true' ||
element.getAttribute('contenteditable').toLowerCase() === ''
);
};
export { isContentEditable };