draft-js-plugins-editor
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -6,2 +6,5 @@ # Change Log | ||
## 2.0.3 | ||
- Bugfix - componentWillReceiveProps causes infite update loop in some circumstances | ||
## 2.0.2 | ||
@@ -8,0 +11,0 @@ - Automatically update decoratorless editorState upon props update |
@@ -97,7 +97,13 @@ 'use strict'; | ||
value: function componentWillReceiveProps(next) { | ||
if (this.props.editorState.getDecorator() !== null && this.props.editorState.getDecorator() !== next.editorState.getDecorator()) { | ||
var decorator = this.props.editorState.getDecorator(); | ||
var editorState = _draftJs.EditorState.set(next.editorState, { decorator: decorator }); | ||
this.onChange((0, _moveSelectionToEnd2.default)(editorState)); | ||
} | ||
var curr = this.props; | ||
var currDec = curr.editorState.getDecorator(); | ||
var nextDec = next.editorState.getDecorator(); | ||
if (currDec === nextDec) return; | ||
if (currDec && nextDec && currDec.decorators.size === nextDec.decorators.size) return; | ||
if (!currDec && nextDec) return; | ||
var decorator = curr.editorState.getDecorator(); | ||
var editorState = _draftJs.EditorState.set(next.editorState, { decorator: decorator }); | ||
this.onChange(editorState); | ||
} | ||
@@ -104,0 +110,0 @@ }, { |
{ | ||
"name": "draft-js-plugins-editor", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Editor for DraftJS Plugins", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58111
1198