diff --git a/src/Codemirror.js b/src/Codemirror.js index b372f96..57cfbbb 100644 --- a/src/Codemirror.js +++ b/src/Codemirror.js @@ -63,7 +63,7 @@ const CodeMirror = createReactClass({ } }, componentWillReceiveProps: function (nextProps) { - if (this.codeMirror && nextProps.value !== undefined && nextProps.value !== this.props.value && normalizeLineEndings(this.codeMirror.getValue()) !== normalizeLineEndings(nextProps.value)) { + if (this.codeMirror && nextProps.value !== undefined && nextProps.value !== this.codeMirror.getValue() && normalizeLineEndings(this.codeMirror.getValue()) !== normalizeLineEndings(nextProps.value)) { if (this.props.preserveScrollPosition) { var prevScrollPosition = this.codeMirror.getScrollInfo(); this.codeMirror.setValue(nextProps.value);