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 <me@alexvanandel.com>
This commit is contained in:
co-authored by
Alex van Andel
parent
8a440c24c0
commit
82ea4e9fb7
@@ -37,7 +37,7 @@ const Switch = (
|
||||
)}>
|
||||
<PrimitiveSwitch.Root
|
||||
className={cx(
|
||||
props.checked ? "bg-inverted" : "bg-emphasis",
|
||||
props.checked || props.defaultChecked ? "bg-inverted" : "bg-emphasis",
|
||||
primitiveProps.disabled && "cursor-not-allowed",
|
||||
"focus:ring-brand-default h-5 w-[34px] rounded-full shadow-none",
|
||||
props.className
|
||||
@@ -47,7 +47,7 @@ const Switch = (
|
||||
id={id}
|
||||
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]",
|
||||
props.checked ? "bg-default shadow-inner" : "bg-inverted",
|
||||
props.checked || props.defaultChecked ? "bg-default shadow-inner" : "bg-inverted",
|
||||
classNames?.thumb
|
||||
)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user