Closed stianlik closed 5 years ago
i'm looking into letting it accept value/label pairs in addition to strings now! Ran into a snag with determining which list element to focus on open, but should have it working soon :)
"Additionally, we don't want to submit a label field into the component, this should be optional. In our case the label is rendered elsewhere (see #330)."
This is being addressed in a separate issue (#366)
Is your feature request related to a problem? Please describe.
Alternative answers in AHV includes both value and display name. I.e. if we need to select a country, we could have a model like the following:
In this case, we'd like to display
name
to the user, whilst we usevalue
internally. In Jøkul, we have to index values by name and translate back and forth to handle changes:Describe the solution you'd like
Ideally, the dropdown component should support value and display value fields so that we could render the component as shown below.
Additionally, we don't want to submit a label field into the component, this should be optional. In our case the label is rendered elsewhere (see #330).
Describe alternatives you've considered
We currently translate between text and value outside the component, it works, but it's not a good solution.