mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
dbeaver/pro#5550 fallback to checked state first (#3398)
* dbeaver/pro#5550 fallback to checked state first * dbeaver/pro#5550 check for boolean type --------- Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
This commit is contained in:
@@ -58,7 +58,7 @@ export function useCheckboxState<TKey extends string>(options: CheckboxStateOpti
|
||||
checked = !!currentState;
|
||||
}
|
||||
} else {
|
||||
checked = false;
|
||||
checked = checked ?? false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -45,6 +45,10 @@ function getValue(value: any, controlType: ObjectPropertyType) {
|
||||
return checkbox ? false : '';
|
||||
}
|
||||
|
||||
if (typeof value === 'boolean') {
|
||||
return checkbox ? value : String(value);
|
||||
}
|
||||
|
||||
if (typeof value === 'string') {
|
||||
return checkbox ? value.toLowerCase() === 'true' : value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user