@monaco-editor/react
Advanced tools
Comparing version 3.4.1 to 3.4.2
### Versions | ||
## 3.4.2 | ||
###### *July 15, 2020* | ||
- controlled editor: fix undo/redo issue | ||
## 3.4.1 | ||
@@ -4,0 +9,0 @@ ###### *July 3, 2020* |
@@ -35,3 +35,3 @@ "use strict"; | ||
if (currentValue !== previousValue.current && !(ev.isUndoing || ev.isRedoing)) { | ||
if (currentValue !== previousValue.current) { | ||
previousValue.current = currentValue; | ||
@@ -41,6 +41,4 @@ | ||
if (typeof _value === 'string') { | ||
if (currentValue !== _value) { | ||
editor.setValue(_value); | ||
} | ||
if (typeof _value === 'string' && currentValue !== _value) { | ||
editor.setValue(_value); | ||
} | ||
@@ -47,0 +45,0 @@ } |
@@ -79,13 +79,15 @@ "use strict"; | ||
} else { | ||
editorRef.current.executeEdits('', [{ | ||
range: editorRef.current.getModel().getFullModelRange(), | ||
text: value | ||
}]); | ||
if (value !== editorRef.current.getValue()) { | ||
editorRef.current.executeEdits('', [{ | ||
range: editorRef.current.getModel().getFullModelRange(), | ||
text: value | ||
}]); | ||
if (_isControlledMode) { | ||
var model = editorRef.current.getModel(); | ||
model.forceTokenization(model.getLineCount()); | ||
if (_isControlledMode) { | ||
var model = editorRef.current.getModel(); | ||
model.forceTokenization(model.getLineCount()); | ||
} | ||
editorRef.current.pushUndoStop(); | ||
} | ||
editorRef.current.pushUndoStop(); | ||
} | ||
@@ -92,0 +94,0 @@ }, [value], isEditorReady); |
{ | ||
"name": "@monaco-editor/react", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "Monaco editor wrapper for easy/one-line integration with React applications (e.g. powered by create-react-app) without need of webpack configuration files", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
65003