mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-13 18:53:59 +02:00
Use isContentEditable
HTML element property to check if an element
is editable.
This commit is contained in:
@@ -710,10 +710,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
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user