formio / formio.js

JavaScript powered Forms with JSON Form Builder
https://formio.github.io/formio.js
MIT License
1.83k stars 1.04k forks source link

FIO-8091: Fixed missing metadata for html5 select component with defa… #5579

Closed roma-formio closed 2 months ago

roma-formio commented 2 months ago

…ult value

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-8091

Description

The issue was that the select component had the logic to set metadata inside the normalizeSingleValue method and for html5 select component with default value this part was unreachable. As the normalizeSingleValue method is supposed to return the correct value based on type, it shouldn't contain any side effects like set metadata. In that case, I moved that logic to the separate setMetadata method and using it only when the select component is trying to update the value.

How has this PR been tested?

Unit tests

Checklist: