Skip to content

Commit

Permalink
fix bug with styling of unchecked checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
wolflu05 committed Sep 19, 2024
1 parent 854d767 commit 19e58aa
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,21 +220,30 @@ export const InputGroup = <T extends any[]>({ state }: { state: UseInputGroupSta
}

if (input.type === "checkbox") {
const indeterminate = input.icon ? !value[key] : false;
return (
<Checkbox
mt={10}
mr={8}
style={{ alignSelf: "flex-end" }}
styles={{
label: { fontSize: "0.875rem", cursor: "pointer" },
input: { cursor: "pointer" },
input: {
cursor: "pointer",
...(indeterminate
? {
background: "var(--mantine-color-gray-4)",
border: "none",
}
: {}),
},
}}
icon={({ className }) =>
input.icon ? <input.icon className={className} /> : <IconCheck className={className} />
}
disabled={input.disabled}
label={input.label ? input.label : undefined}
indeterminate={input.icon ? !value[key] : false}
indeterminate={indeterminate}
checked={value[key]}
onChange={(e) => {
setValue(key, e.currentTarget.checked);
Expand Down

0 comments on commit 19e58aa

Please sign in to comment.