mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2025-02-23 17:49:49 +08:00
fix(BooleanField): convert only the values that exist
This commit is contained in:
parent
caf7eb2eeb
commit
25662863a7
@ -16,7 +16,7 @@ export const BooleanField: React.FC<WidgetProps<BooleanFieldType>> = props => {
|
||||
|
||||
useEffect(() => {
|
||||
// Convert value to boolean after switch from expression widget mode.
|
||||
if (typeof value !== 'boolean') {
|
||||
if (value && typeof value !== 'boolean') {
|
||||
onChange(true);
|
||||
}
|
||||
}, [onChange, value]);
|
||||
|
Loading…
Reference in New Issue
Block a user