Skip to content

Conversation

mpetit-boop
Copy link

Link to Jira Ticket

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

Description

What changed?

The select component, with HTML 5 as the display type, did not support multiple values when that option was selected.

This PR updates the setValue() and updateValue() logic in the Select component to correctly handle multiple values and improve event handling in HTML5 mode.

  • Adjusted setValue() to support arrays of values.
  • Updated updateValue() to correctly merge modified values.
  • Enhanced attach() to better handle change events for multiple selections.

Fixes #5572.

Why have you chosen this solution?

The conditions were added to ensure that the values are stored in an array if the multiple values option is selected in HTML 5 mode, while minimizing the impact this could have on the existing logic also shared when in ChoicesJS mode.

Breaking Changes / Backwards Compatibility

I do not believe this code can potentially break changes or have any adverse effects on backwards compatibility.

Dependencies

There are no dependent changes/PRs in other Form.io modules.

How has this PR been tested?

This was tested locally, with different select component settings:

  • a select using HTML 5 and with the multiple values option enabled
  • a select using HTML 5 without the multiple values option
  • a select using Choices JS with multiple values option enabled
  • a select using Choices JS without the multiple values option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select component with a "Widget type" of "HTML 5" and "Multiple Values" set to true does not allow for multiple values to be selected

1 participant