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

Fix #385: Re-render when selection state changed for a node (#387)

* Re-render when selection state changed for a node

* Change condition to be an OR (focus or selection changed)
This commit is contained in:
Samy Pessé
2016-10-18 01:33:21 +02:00
committed by Ian Storm Taylor
parent b7eb15dfad
commit 582603a7e8

View File

@@ -125,8 +125,10 @@ class Node extends React.Component {
// the node, to allow for intuitive selection-based rendering.
if (
this.props.node.kind != 'text' &&
this.props.state.isFocused &&
this.props.state.selection.hasEdgeIn(this.props.node)
(
props.state.isFocused != this.props.state.isFocused ||
this.props.state.selection.hasEdgeIn(this.props.node) != props.state.selection.hasEdgeIn(props.node)
)
) {
return true
}