diff --git a/lib/components/node.js b/lib/components/node.js index 7b29e7a68..3a91463ec 100644 --- a/lib/components/node.js +++ b/lib/components/node.js @@ -95,10 +95,26 @@ class Node extends React.Component { return true } - // Otherwise, perform a peformant update check by default. + // If the node has changed, update. + if (props.node != this.props.node) { + return true + } + + // If the selection is focused and is inside the node, we need to update so + // that the selection will be set by one of the components. if ( - props.node != this.props.node || - (props.state.isFocused && props.state.selection.hasEdgeIn(props.node)) + props.state.isFocused && + props.state.selection.hasEdgeIn(props.node) + ) { + return true + } + + // If the selection is blurred but was previously focused inside the node, + // we need to update to ensure the selection gets updated by re-rendering. + if ( + props.state.isBlurred && + this.props.state.isFocused && + this.props.state.selection.hasEdgeIn(props.node) ) { return true }