Skip to content

Commit 3d69379

Browse files
author
React-Admin CI
committed
Add a story for onChange validation mode
1 parent ee103b5 commit 3d69379

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ export const Basic = ({
2323
</Wrapper>
2424
);
2525

26+
export const OnChangeValidation = ({
27+
dateInputProps = {
28+
validate: value => {
29+
console.log({ value });
30+
return undefined;
31+
},
32+
},
33+
simpleFormProps = { mode: 'onChange' },
34+
}: {
35+
dateInputProps?: Partial<DateInputProps>;
36+
simpleFormProps?: Partial<SimpleFormProps>;
37+
}) => (
38+
<Wrapper simpleFormProps={simpleFormProps}>
39+
<DateInput source="publishedAt" {...dateInputProps} />
40+
</Wrapper>
41+
);
42+
2643
export const NonFullWidth = () => (
2744
<Wrapper>
2845
<DateInput source="published" fullWidth={false} />

0 commit comments

Comments
 (0)