Skip to content

Commit

Permalink
fix: readonly style
Browse files Browse the repository at this point in the history
  • Loading branch information
toshusai committed Feb 21, 2024
1 parent dabe2f7 commit 6503c3d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/react/src/components/Checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
return (
<InputRoot aria-disabled={isDisabled} className={props.className}>
<CheckboxRoot>
<CheckboxInput type="checkbox" {...inputProps} />
<CheckboxInput
type="checkbox"
{...inputProps}
readOnly={props.readonly}
/>
<CheckboxInputOverlay aria-hidden={true} checked={inputProps.checked}>
<Icon name="24/Check" unsafeNonGuidelineScale={2 / 3} />
</CheckboxInputOverlay>
Expand Down Expand Up @@ -108,6 +112,9 @@ const CheckboxInput = styled.input`
&:disabled {
cursor: default;
}
&:read-only {
cursor: default;
}
&:checked {
background-color: var(--charcoal-brand);
Expand Down

0 comments on commit 6503c3d

Please sign in to comment.