-
Notifications
You must be signed in to change notification settings - Fork 85
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
fix: accept boolean and numeric item values #4064
fix: accept boolean and numeric item values #4064
Conversation
Kudos, SonarCloud Quality Gate passed!
|
select
accept non-string valuesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'm not sure if using true
and false
as vaadin-item
values is something we should promote in the docs (personally, I would use a checkbox). But it's a relatively small feature so 🤷♂️
I agree with you. The need came from vaadin/hilla#177. Might be a bit more useful with numbers anyway. |
Co-authored-by: Luciano Vernaschi <[email protected]>
Is a similar change planned for components other than For example, in the following cases: <vaadin-radio-group label="Travel class">
<vaadin-radio-button value="1" label="Economy"></vaadin-radio-button>
<vaadin-radio-button value="2" label="Business"></vaadin-radio-button>
</vaadin-radio-group> comboBox.items = [
{
label: 'foo',
value: '1',
},
{
label: 'bar',
value: '2',
},
]; ...this works: |
There is an issue for supporting array of numbers in |
Description
When the
vaadin-select
component receives a value which is not a string, it should be able to find the corresponding item anyway. This fix simply convert the new value to string before searching for it. This will also allow Hilla to bindselect
s to boolean and integers.Fixes #4059
Type of change
Checklist