diff --git a/packages/amis-ui/src/components/DiffEditor.tsx b/packages/amis-ui/src/components/DiffEditor.tsx index b793d634d5e..4435f3fc477 100644 --- a/packages/amis-ui/src/components/DiffEditor.tsx +++ b/packages/amis-ui/src/components/DiffEditor.tsx @@ -24,6 +24,12 @@ export default class DiffEditor extends React.Component { 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() {