1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 09:59:48 +02:00

Merge branch 'master' of github.com:ianstormtaylor/slate

This commit is contained in:
Ian Storm Taylor
2018-09-26 13:12:42 -07:00
5 changed files with 293 additions and 3 deletions

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)
)
}

View File

@@ -436,8 +436,10 @@ class ElementInterface {
*/
getDecorations(stack) {
const decorations = stack.find('decorateNode', this)
const list = Decoration.createList(decorations || [])
const allDecorations = stack
.map('decorateNode', this)
.map(decorations => Decoration.createList(decorations))
const list = List(allDecorations).flatten(true)
return list
}