From a57cdbd5b5f4efa94ecc61498fdb4039276f86f0 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 23 Oct 2017 20:10:05 +0900 Subject: dom helper --- src/shared/utils/dom.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/shared/utils/dom.js (limited to 'src/shared/utils/dom.js') diff --git a/src/shared/utils/dom.js b/src/shared/utils/dom.js new file mode 100644 index 0000000..c111ee7 --- /dev/null +++ b/src/shared/utils/dom.js @@ -0,0 +1,8 @@ +const isContentEditable = (element) => { + return element.hasAttribute('contenteditable') && ( + element.getAttribute('contenteditable').toLowerCase() === 'true' || + element.getAttribute('contenteditable').toLowerCase() === '' + ); +}; + +export { isContentEditable }; -- cgit v1.2.3