mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Merge remote-tracking branch 'baidu/master'
This commit is contained in:
commit
50ff14de1b
@ -6,6 +6,8 @@ export function labelToString(label: any): string {
|
||||
return label;
|
||||
} else if (type === 'number') {
|
||||
return `${label}`;
|
||||
} else if (label === 'boolean') {
|
||||
return String(label);
|
||||
}
|
||||
|
||||
if (isPlainObject(label)) {
|
||||
|
@ -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