1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-17 20:51:20 +02:00

Merge pull request #413 from AlbertHilb/isContentEditable

Use `isContentEditable` HTML element property to check if an element is editable
This commit is contained in:
Ian Storm Taylor
2016-11-17 12:00:57 -08:00
committed by GitHub

View File

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