fix: autosave (#6392)

* fix: autosave

* rm: console
This commit is contained in:
Pooja
2025-12-23 19:21:56 +05:30
committed by GitHub
parent d93d1eacdb
commit ce33cee03d
6 changed files with 28 additions and 1 deletions

View File

@@ -228,8 +228,10 @@ export default class CodeEditor extends React.Component {
CodeMirror.signal(this.editor, 'change', this.editor);
}
if (this.props.value !== prevProps.value && this.props.value !== this.cachedValue && this.editor) {
const cursor = this.editor.getCursor();
this.cachedValue = this.props.value;
this.editor.setValue(this.props.value);
this.editor.setCursor(cursor);
}
if (this.editor) {