1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01:00

Normalize copying void inline nodes (#2198)

When a void inline nodes is selected along with other text/content it can be copied to the clipboard. When it’s the only thing selected it is ignored because anything marked contentedtiable=false is.
Updated isInEditor to return true if a contenteditable=false has a parent that is a void inline node.
This commit is contained in:
Grey Osten 2018-09-22 11:13:22 -07:00 committed by Ian Storm Taylor
parent 0f5d95e98e
commit 329dac72d3

View File

@ -284,8 +284,10 @@ class Content extends React.Component {
throw err
}
const allowEdit = el.isContentEditable || el.closest('[data-slate-void]')
return (
el.isContentEditable &&
allowEdit &&
(el === element || el.closest('[data-slate-editor]') === element)
)
}