Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9948a5

Browse files
committed
compare id rather than decorator length
1 parent 9dff885 commit f9948a5

File tree

1 file changed

+1
-5
lines changed
  • draft-js-plugins-editor/src/Editor

1 file changed

+1
-5
lines changed

draft-js-plugins-editor/src/Editor/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ class PluginEditor extends Component {
6565
componentWillReceiveProps(next) {
6666
if (
6767
this.props.editorState.getDecorator() !== null &&
68-
(
69-
next.editorState.getDecorator() === null ||
70-
next.editorState.getDecorator().decorators.size
71-
!== this.props.editorState.getDecorator().decorators.size
72-
)
68+
this.props.editorState.getDecorator() !== next.editorState.getDecorator()
7369
) {
7470
const decorator = this.props.editorState.getDecorator();
7571
const editorState = EditorState.set(next.editorState, { decorator });

0 commit comments

Comments
 (0)