Skip to content

Commit 0b066ac

Browse files
authored
Add not-allowed cursor property on disabled checkbox (#593)
1 parent b211e26 commit 0b066ac

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/components/Checkbox/Checkbox.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ describe("Checkbox", () => {
2727
label: "Accept terms and conditions",
2828
disabled: true,
2929
});
30+
3031
const checkbox = getByTestId("checkbox");
32+
33+
const computedStyle = window.getComputedStyle(checkbox);
34+
expect(computedStyle.cursor).toBe("not-allowed");
35+
3136
fireEvent.click(checkbox);
3237

3338
expect(counter).toEqual(0);

src/components/Checkbox/Checkbox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const CheckInput = styled(RadixCheckbox.Root)<{
9393
&[data-disabled] {
9494
background: ${theme.click.checkbox.color.background.disabled};
9595
border-color: ${theme.click.checkbox.color.stroke.disabled};
96+
cursor: not-allowed;
9697
&[data-state="checked"] {
9798
background: ${theme.click.checkbox.color.background.disabled};
9899
border-color: ${theme.click.checkbox.color.stroke.disabled};

0 commit comments

Comments
 (0)