fix: field hidden with linkage rule should clear value (#3576)

This commit is contained in:
katherinehhh 2024-03-04 17:28:33 +08:00 committed by GitHub
parent 87ed436f8c
commit 09985ed8bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -268,6 +268,10 @@ function getSubscriber(
} }
} else { } else {
field[fieldName] = lastState?.value; field[fieldName] = lastState?.value;
//字段隐藏时清空数据
if (fieldName === 'display' && lastState?.value === 'none') {
field.value = null;
}
} }
// 在这里清空 field.stateOfLinkageRules就可以保证当条件再次改变时如果该字段没有和任何条件匹配则需要把对应的值恢复到初始值 // 在这里清空 field.stateOfLinkageRules就可以保证当条件再次改变时如果该字段没有和任何条件匹配则需要把对应的值恢复到初始值