Skip to content

Commit

Permalink
fix: 修复 diffEditor disabled 状态不更新的问题 (#11078)
Browse files Browse the repository at this point in the history
  • Loading branch information
2betop authored Oct 18, 2024
1 parent cf86d4f commit 07b8031
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/amis-ui/src/components/DiffEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export default class DiffEditor extends React.Component<DiffEditorProps> {
if (this.modifiedEditor && value !== prevProps.value) {
this.modifiedEditor.getModel().setValue(value || '');
}

if (this.props.disabled !== prevProps.disabled && this.modifiedEditor) {
this.modifiedEditor.updateOptions?.({
readOnly: this.props.disabled
});
}
}

componentWillUnmount() {
Expand Down

0 comments on commit 07b8031

Please sign in to comment.