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:
alex
2025-04-28 14:49:30 +08:00
committed by GitHub
co-authored by mr-anton-t
parent 298ce286f1
commit 4253c640cf
2 changed files with 5 additions and 1 deletions
@@ -58,7 +58,7 @@ export function useCheckboxState<TKey extends string>(options: CheckboxStateOpti
checked = !!currentState;
}
} else {
checked = false;
checked = checked ?? false;
}
}
@@ -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;
}