FIO-5687: Fix: Support multiple values in Select component setValue/updateValue in HTML 5 mode#6252
Open
mpetit-boop wants to merge 3 commits into
Open
FIO-5687: Fix: Support multiple values in Select component setValue/updateValue in HTML 5 mode#6252mpetit-boop wants to merge 3 commits into
mpetit-boop wants to merge 3 commits into
Conversation
…le values when display type is HTML 5 (issue formio#5572)
Contributor
|
@mpetit-boop |
Contributor
|
@mpetit-boop |
…alize line endings in Templates.unit.js, and correct nested form typo
Author
|
@lane-formio My apologies for the delay in getting back to you. The tests and merge conflicts have been resolved. Let me know if anything further is necessary! |
Contributor
|
@mpetit-boop Now there's a merge conflict 😞 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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: