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

fix isInContentEditable logic to match children

This commit is contained in:
Ian Storm Taylor
2016-11-21 14:43:11 -08:00
parent 7cd64deb0c
commit ee7656f2ab

View File

@@ -163,8 +163,12 @@ class Content extends React.Component {
*/
isInContentEditable = (event) => {
const { element } = this
const { target } = event
return target.isContentEditable && target === this.element
return (
(target.isContentEditable) &&
(target === element || target.closest('[contenteditable]') == element)
)
}
/**