1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-13 10:44:02 +02:00

Use isContentEditable HTML element property to check if an element

is editable.
This commit is contained in:
Raffaele De Feo
2016-11-02 17:49:30 +01:00
parent d4eb53fd6f
commit beacdb0f55

View File

@@ -710,10 +710,8 @@ class Content extends React.Component {
*/ */
function isNonEditable(event) { function isNonEditable(event) {
const { target, currentTarget } = event const { target } = event
const nonEditable = target.closest('[contenteditable="false"]') return !target.isContentEditable
const isContained = currentTarget.contains(nonEditable)
return isContained
} }
/** /**