mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
fix: 配置面板首次变更无效 (#10936)
This commit is contained in:
parent
cb5e5dca5e
commit
ad77f24feb
@ -101,8 +101,6 @@ export function SchemaFrom({
|
||||
return schema;
|
||||
}, [body, controls, submitOnChange]);
|
||||
|
||||
const [init, setInit] = React.useState(true);
|
||||
|
||||
const themeConfig = React.useMemo(() => getThemeConfig(), []);
|
||||
const submitSubscribers = React.useRef<Array<Function>>([]);
|
||||
const subscribeSubmit = React.useCallback(
|
||||
@ -149,8 +147,7 @@ export function SchemaFrom({
|
||||
newValue = pipeOut ? await pipeOut(newValue, value) : newValue;
|
||||
const diffValue = diff(value, newValue);
|
||||
// 没有变化时不触发onChange
|
||||
if (!diffValue || init) {
|
||||
setInit(false);
|
||||
if (!diffValue) {
|
||||
return;
|
||||
}
|
||||
onChange(newValue, diffValue, (schema, value, id, diff) => {
|
||||
|
@ -229,7 +229,7 @@ export default class SelectControl extends React.Component<SelectProps, any> {
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.input && this.input?.focus();
|
||||
this.input && this.input?.focus?.();
|
||||
}
|
||||
|
||||
getValue(
|
||||
|
Loading…
Reference in New Issue
Block a user