Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way of prefilling a select field. #261

Open
hugo-lobo opened this issue Aug 19, 2022 · 0 comments
Open

No way of prefilling a select field. #261

hugo-lobo opened this issue Aug 19, 2022 · 0 comments

Comments

@hugo-lobo
Copy link

During testing of one of our flows it was noticed that the select field didn't have the correct option prefilled.
After investigating I found that passing a prefilled value to a dropdown (select) type field will cause all options in the list to have the selected attribute in the HTML due to the mustache logic in your select.html template.

Using objects as the values of an enum array:
customer_fields: { select_field_example: { enum: [ {value: 'Option 1', prefilled: true}, {value: 'Option 2'} ] } } }
works to select only one of the options but then it will render as [object Object] when using the dropdown as the binding in the mustache template refers to it by the {.} syntax, referencing the whole object.

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

No branches or pull requests

1 participant