Skip to content

Commit

Permalink
🐛 [open-formulieren/open-forms#4772] Set select dataType to string
Browse files Browse the repository at this point in the history
because Select components did not have a dataType set, formio tries to cast it to other types if possible, which causes issues when submitting the data to the backend. For that reason we set the value to string to avoid this unwanted normalization
  • Loading branch information
stevenbal authored and sergei-maertens committed Nov 12, 2024
1 parent 2b5adeb commit 73bc298
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@formatjs/cli": "^6.1.1",
"@formatjs/ts-transformer": "^3.12.0",
"@fortawesome/fontawesome-free": "^6.4.0",
"@open-formulieren/types": "^0.33.0",
"@open-formulieren/types": "^0.34.0",
"@storybook/addon-actions": "^8.3.5",
"@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.5",
Expand Down
1 change: 1 addition & 0 deletions src/registry/select/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ EditForm.defaultValues = {
// fixed, this is what itemsExpression results in via the backend. Do not confuse with
// openForms.dataSrc!
dataSrc: 'values',
dataType: 'string',
data: {values: [{value: '', label: ''}]},
// TODO: at some point we can allow an itemsExpression for this too
// Note: Formio will override this to `null`! So be careful when dealing with
Expand Down

0 comments on commit 73bc298

Please sign in to comment.