Vaadin 8: NativeSelect that does not allow empty codes shows selection but

This really feels like a bug.

  1. Create a NativeSelect field
  2. Populate it with a list of items for the user to select from
  3. Set it to not allow empty codes.
  4. Bind to a property of a Java bean that has a null value
  5. Observe that the combo will display the first item from the list (in Vaadin 7 it used to remain empty)
  6. Both the value of the field and the property will be null… but the combo on the page WILL SHOW that the first item is selected!

Why does it show a selected item if its value remains empty!!! How is the user supposed to select the first value then?

It should either show blank on the page like it did in Vaadin 7(compatibility is good!) or populate the field value with the selected value.

Hi,

You can create a bug ticket here:
github.com/vaadin/framework/issues

If you can include a simple project that reproduces the issue, that helps a lot.

Best regards,

Olli

Olli,

Thanks, I will create a bug and put together an example to illustrate the issue with NativeSelect that does not allow empty codes.

What do you think of
https://vaadin.com/forum#!/thread/16545642

While it may be argued it is not technically a bug, it causes a lot of compatibility issues going from 7 to 8 (at least to us!)… and it makes value change listeners in 8 much less useful (at least to us).
Please take a look and let me know what you think.

Thanks a lot,
Sergei

Create a new issue:

https://github.com/vaadin/framework/issues/9854

I don’t have an immediate comment on it, but feel free to create a ticket about it as well. If you can illustrate a use case where it doesn’t work anymore, that will give more weight to the issue.

-Olli