Skip to content

Commit e61aeb4

Browse files
🚨 [#4606] Fix warning about uncontrolled/controlled components in storybook
Only affected the stories, as the Formik initialValues is initialized incorrectly there.
1 parent 1540ab4 commit e61aeb4

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/openforms/js/components/admin/form_design/registrations/zgw/ZGWOptionsFormFields.stories.js

+20-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,26 @@ import {
2020
const NAME = 'form.registrationBackends.0.options';
2121

2222
const render = ({apiGroups, objectsApiGroupChoices, confidentialityLevelChoices, formData}) => (
23-
<Formik initialValues={formData} onSubmit={fn()}>
23+
<Formik
24+
initialValues={{
25+
// defaults
26+
caseTypeIdentification: '',
27+
documentTypeDescription: '',
28+
zaaktype: '',
29+
informatieobjecttype: '',
30+
organisatieRsin: '',
31+
zaakVertrouwelijkheidaanduiding: '',
32+
medewerkerRoltype: '',
33+
propertyMappings: [],
34+
productUrl: '',
35+
// Ensure that this is explicitly set to null instead of undefined,
36+
// because the field is required by the serializer
37+
objectsApiGroup: null,
38+
// saved data, overwrites defaults
39+
...formData,
40+
}}
41+
onSubmit={fn()}
42+
>
2443
<Form data-testid="test-form">
2544
<ZGWFormFields
2645
index={0}

0 commit comments

Comments
 (0)