fix: solve incorrect type when dealing with value in list #3094
+6
−0
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.
Description
Please include a summary of the changes and the related issues.
This fix solves the issue 3093 where the output coming from the dynamic form input has the wrong type. This lead to weird behaviour when selecting the options and also issue with updating the record on the admin UI.
My fix consists of overriding the value with the correct type, I'm unsure if this is a acceptable solution, but it does solve the issue.
For example.
I have a list of options from a custom field that contains numbers like calling code.
The options are meant to be strings of options. so it's configured like this
When I select the first option, the output will become like this
The issue arises when my form input is a list, and I want to add the second option, which will cause the first option to turn into a number, so it will become like this
if I change the first input again, it will become like this
Breaking changes
Does this PR include any breaking changes we should be aware of?
I'm not very sure, is there any test that I can run ?
Screenshots
Before
After
You can add screenshots here if applicable.
Checklist
📌 Always:
👍 Most of the time: