fix: switch bg when default checked (#8129)
* fix: switch bg * Update packages/ui/components/form/switch/Switch.tsx Remove accidental space --------- Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
1 parent
8a440c24c0
commit
82ea4e9fb7
1 file changed
+2
-2
@@ -37,7 +37,7 @@ const Switch = (
|
|||||||
)}>
|
)}>
|
||||||
<PrimitiveSwitch.Root
|
<PrimitiveSwitch.Root
|
||||||
className={cx(
|
className={cx(
|
||||||
props.checked ? "bg-inverted" : "bg-emphasis",
|
props.checked || props.defaultChecked ? "bg-inverted" : "bg-emphasis",
|
||||||
primitiveProps.disabled && "cursor-not-allowed",
|
primitiveProps.disabled && "cursor-not-allowed",
|
||||||
"focus:ring-brand-default h-5 w-[34px] rounded-full shadow-none",
|
"focus:ring-brand-default h-5 w-[34px] rounded-full shadow-none",
|
||||||
props.className
|
props.className
|
||||||
@@ -47,7 +47,7 @@ const Switch = (
|
|||||||
id={id}
|
id={id}
|
||||||
className={cx(
|
className={cx(
|
||||||
"block h-[14px] w-[14px] rounded-full transition will-change-transform ltr:translate-x-[4px] rtl:-translate-x-[4px] ltr:[&[data-state='checked']]:translate-x-[17px] rtl:[&[data-state='checked']]:-translate-x-[17px]",
|
"block h-[14px] w-[14px] rounded-full transition will-change-transform ltr:translate-x-[4px] rtl:-translate-x-[4px] ltr:[&[data-state='checked']]:translate-x-[17px] rtl:[&[data-state='checked']]:-translate-x-[17px]",
|
||||||
props.checked ? "bg-default shadow-inner" : "bg-inverted",
|
props.checked || props.defaultChecked ? "bg-default shadow-inner" : "bg-inverted",
|
||||||
classNames?.thumb
|
classNames?.thumb
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user