@@ -36,43 +36,43 @@ export default {
36
36
parameters : { controls : { exclude : baseProps } } ,
37
37
} ;
38
38
39
- const UnknownSubmitErrorTemplate : StoryFn < typeof Form > = ( args ) => {
40
- const [ form ] = Form . useForm ( ) ;
41
-
42
- return (
43
- < Form
44
- form = { form }
45
- { ...args }
46
- onSubmit = { ( v ) => {
47
- console . log ( 'onSubmit:' , v ) ;
48
-
49
- throw new Error ( 'Unknown error' ) ;
50
- } }
51
- onSubmitFailed = { ( e ) => {
52
- console . log ( 'onSubmitFailed' , e ) ;
53
- } }
54
- onValuesChange = { ( v ) => {
55
- console . log ( 'onChange' , v ) ;
56
- } }
57
- >
58
- < Field
59
- name = "text"
60
- label = "Text input"
61
- rules = { [
62
- ( ) => ( {
63
- async validator ( ) {
64
- await timeout ( 1000 ) ;
65
- } ,
66
- } ) ,
67
- ] }
68
- >
69
- < TextInput />
70
- </ Field >
71
- < Submit > Submit</ Submit >
72
- < SubmitError />
73
- </ Form >
74
- ) ;
75
- } ;
39
+ // const UnknownSubmitErrorTemplate: StoryFn<typeof Form> = (args) => {
40
+ // const [form] = Form.useForm();
41
+ //
42
+ // return (
43
+ // <Form
44
+ // form={form}
45
+ // {...args}
46
+ // onSubmit={(v) => {
47
+ // console.log('onSubmit:', v);
48
+ //
49
+ // throw new Error('Unknown error');
50
+ // }}
51
+ // onSubmitFailed={(e) => {
52
+ // console.log('onSubmitFailed', e);
53
+ // }}
54
+ // onValuesChange={(v) => {
55
+ // console.log('onChange', v);
56
+ // }}
57
+ // >
58
+ // <Field
59
+ // name="text"
60
+ // label="Text input"
61
+ // rules={[
62
+ // () => ({
63
+ // async validator() {
64
+ // await timeout(1000);
65
+ // },
66
+ // }),
67
+ // ]}
68
+ // >
69
+ // <TextInput />
70
+ // </Field>
71
+ // <Submit>Submit</Submit>
72
+ // <SubmitError />
73
+ // </Form>
74
+ // );
75
+ // };
76
76
77
77
const CustomSubmitErrorTemplate : StoryFn < typeof Form > = ( args ) => {
78
78
const [ form ] = Form . useForm ( ) ;
@@ -387,8 +387,8 @@ ErrorMessage.play = CustomErrorMessage.play = async ({ canvasElement }) => {
387
387
await waitFor ( ( ) => expect ( canvas . getByRole ( 'alert' ) ) . toBeInTheDocument ( ) ) ;
388
388
} ;
389
389
390
- export const UnknownErrorMessage = UnknownSubmitErrorTemplate . bind ( { } ) ;
391
-
390
+ // export const UnknownErrorMessage = UnknownSubmitErrorTemplate.bind({});
391
+ //
392
392
// UnknownErrorMessage.play = async ({ canvasElement }) => {
393
393
// const canvas = within(canvasElement);
394
394
// const button = await canvas.getByRole('button');
0 commit comments