- Fix the checkbox position to be conditional on non string label

This commit is contained in:
Shemy Gan committed 2024-12-06 09:46:16 -05:00
1 parent 136ed04b3a
commit 4345d6988b
1 file changed
+2 -1
@@ -40,6 +40,7 @@ const Checkbox = ({
/* TODO move sizes to theme */ /* TODO move sizes to theme */
const sizes = { small: "14px", medium: "16px", large: "18px" }; const sizes = { small: "14px", medium: "16px", large: "18px" };
const theme = useTheme(); const theme = useTheme();
const override = typeof label == "string" ? {} : { alignSelf: "flex-start" };
return ( return (
<FormControlLabel <FormControlLabel
className="checkbox-wrapper" className="checkbox-wrapper"
@@ -57,7 +58,7 @@ const Checkbox = ({
sx={{ sx={{
"&:hover": { backgroundColor: "transparent" }, "&:hover": { backgroundColor: "transparent" },
"& svg": { width: sizes[size], height: sizes[size] }, "& svg": { width: sizes[size], height: sizes[size] },
alignSelf: "flex-start", ...override
}} }}
/> />
} }