Skip to content

Commit 91c5a83

Browse files
committed
Improve Disabled story to test default value when boolean input is disabled.
1 parent 69abefb commit 91c5a83

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

packages/ra-ui-materialui/src/input/BooleanInput.stories.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,35 @@ export const Basic = () => (
1818
</Wrapper>
1919
);
2020

21-
export const Disabled = () => (
21+
export const Disabled = ({
22+
defaultValue,
23+
disabled,
24+
}: {
25+
defaultValue: boolean;
26+
disabled: boolean;
27+
}) => (
2228
<Wrapper>
23-
<BooleanInput source="published" disabled />
29+
<BooleanInput
30+
source="published"
31+
defaultValue={defaultValue}
32+
disabled={disabled}
33+
/>
2434
</Wrapper>
2535
);
2636

37+
Disabled.argTypes = {
38+
defaultValue: {
39+
control: 'boolean',
40+
},
41+
disabled: {
42+
control: 'boolean',
43+
},
44+
};
45+
Disabled.args = {
46+
defaultValue: true,
47+
disabled: true,
48+
};
49+
2750
export const ReadOnly = () => (
2851
<Wrapper>
2952
<BooleanInput source="published" readOnly />

0 commit comments

Comments
 (0)