This commit is contained in:
parent
f7959bc887
commit
ab2e6c19a4
1 changed files with 2 additions and 1 deletions
|
|
@ -61,7 +61,8 @@ const Form: FC<FormProps> = ({
|
||||||
const shouldClearVariable: Record<string, string | undefined> = {}
|
const shouldClearVariable: Record<string, string | undefined> = {}
|
||||||
if (showOnVariableMap[key]?.length) {
|
if (showOnVariableMap[key]?.length) {
|
||||||
showOnVariableMap[key].forEach((clearVariable) => {
|
showOnVariableMap[key].forEach((clearVariable) => {
|
||||||
shouldClearVariable[clearVariable] = undefined
|
const schema = formSchemas.find(it => it.variable === clearVariable)
|
||||||
|
shouldClearVariable[clearVariable] = schema ? schema.default : undefined
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
onChange({ ...value, [key]: val, ...shouldClearVariable })
|
onChange({ ...value, [key]: val, ...shouldClearVariable })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue