mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-25 16:20:49 +02:00
Skip operations on child nodes if !node.nodes.size (#2365)
* Skip operations on child nodes if !node.nodes.size Avoid running decoration and text decoration related functions on child nodes that don't exist. * Uses isLeafBlock * Restores the original order of statements
This commit is contained in:
committed by
Ian Storm Taylor
parent
fac8228f23
commit
0436ad4a64
@@ -151,7 +151,7 @@ class Node extends React.Component {
|
||||
|
||||
// If it's a block node with inline children, add the proper `dir` attribute
|
||||
// for text direction.
|
||||
if (node.object == 'block' && node.nodes.first().object != 'block') {
|
||||
if (node.isLeafBlock()) {
|
||||
const direction = node.getTextDirection()
|
||||
if (direction == 'rtl') attributes.dir = 'rtl'
|
||||
}
|
||||
|
Reference in New Issue
Block a user