mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 04:48:32 +08:00
Merge pull request #8015 from igrowp/fix-some-bug
fix: diffEditor组件在某些场景下使用变量时导致页面卡死的问题
This commit is contained in:
commit
60e2743cf6
@ -199,7 +199,14 @@ export class DiffEditor extends React.Component<DiffEditorProps, any> {
|
|||||||
value !== prevProps.value &&
|
value !== prevProps.value &&
|
||||||
!this.state.focused
|
!this.state.focused
|
||||||
) {
|
) {
|
||||||
this.modifiedEditor.getModel().setValue(normalizeValue(value, language));
|
this.modifiedEditor.getModel().setValue(
|
||||||
|
isPureVariable(value as string)
|
||||||
|
? normalizeValue(
|
||||||
|
resolveVariableAndFilter(value || '', data, '| raw', () => ''),
|
||||||
|
language
|
||||||
|
)
|
||||||
|
: normalizeValue(value, language)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,10 +178,11 @@ export class SearchBoxRenderer extends React.Component<
|
|||||||
this.setState({value: ''});
|
this.setState({value: ''});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setData(value: any) {
|
setData(value: any) {
|
||||||
|
if (typeof value === 'string') {
|
||||||
this.setState({value});
|
this.setState({value});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
|
Loading…
Reference in New Issue
Block a user