fix: re-apply masking in MultiLineEditor and SingleLineEditor after setValue() to preserve CodeMirror marks (#7585)

This commit is contained in:
Abhishek S Lal
2026-03-26 20:10:38 +05:30
committed by lohit-bruno
parent b585c3e943
commit 51e2c045ec
2 changed files with 8 additions and 0 deletions

View File

@@ -164,6 +164,10 @@ class MultiLineEditor extends Component {
this.cachedValue = nextValue;
this.editor.setValue(nextValue);
this.editor.setCursor(cursor);
// Re-apply masking after setValue() since it destroys all CodeMirror marks
if (this.maskedEditor && this.maskedEditor.isEnabled()) {
this.maskedEditor.update();
}
}
}
if (!isEqual(this.props.isSecret, prevProps.isSecret)) {

View File

@@ -179,6 +179,10 @@ class SingleLineEditor extends Component {
this.cachedValue = nextValue;
this.editor.setValue(nextValue);
this.editor.setCursor(cursor);
// Re-apply masking after setValue() since it destroys all CodeMirror marks
if (this.maskedEditor && this.maskedEditor.isEnabled()) {
this.maskedEditor.update();
}
// Update newline markers after value change
if (this.props.showNewlineArrow) {