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

@@ -154,8 +154,10 @@ class MultiLineEditor extends Component {
this.editor.setOption('readOnly', this.props.readOnly);
}
if (this.props.value !== prevProps.value && this.props.value !== this.cachedValue && this.editor) {
const cursor = this.editor.getCursor();
this.cachedValue = String(this.props.value);
this.editor.setValue(String(this.props.value) || '');
this.editor.setCursor(cursor);
}
if (!isEqual(this.props.isSecret, prevProps.isSecret)) {
// If the secret flag has changed, update the editor to reflect the change