Skip to content

Commit 845b139

Browse files
committed
fix: fix disabled state when not using forms API
1 parent 108a958 commit 845b139

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

projects/code-editor/code-editor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ export class CodeEditor implements OnChanges, OnInit, OnDestroy, ControlValueAcc
182182
if (changes['value']) {
183183
this.setValue(this.value);
184184
}
185+
if (changes['disabled']) {
186+
this.setEditable(!this.disabled);
187+
}
185188
if (changes['readonly']) {
186189
this.setReadonly(this.readonly);
187190
}

projects/code-editor/diff-editor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ export class DiffEditor implements OnChanges, OnInit, OnDestroy, ControlValueAcc
188188
if (changes['diffConfig']) {
189189
this.mergeView?.reconfigure({ diffConfig: this.diffConfig });
190190
}
191+
if (changes['disabled']) {
192+
this.setEditable('a', !this.disabled);
193+
this.setEditable('b', !this.disabled);
194+
}
191195
}
192196

193197
ngOnInit(): void {

0 commit comments

Comments
 (0)