NativeSelect ignores setWidth (Vaadin 8.0.0)

When setting width of NativeSelect with setWidth, the setting is ignored and the Component is sized automatically to its biggest entry. This causes layout problems, if a NativeSelect has very long entries.

Were there any changes to Vaadin 8 I don’t know or is this a bug?

There more I look into it, it looks like a bug…

In debugmode it highlights correctly only 270px, which is the value set by setWidth, but it is displayed much wider!

A simple example using a clean new Vaadin 8 project:

public class MyUI extends UI {

protected void init(VaadinRequest vaadinRequest) {
    final VerticalLayout layout = new VerticalLayout();
    List<String> myList = Arrays.asList("Test 1",
                                        "Test 2",
                                        "Test very long Test very long Test very long Test very long Test very long Test very long ");
    final NativeSelect<String> nsTest = new NativeSelect<>("Test", myList);

@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {


Hi Thomas,

Looks like a bug to me too, I was going to suggest opening an issue in github, but noticed you arleady did
, as a temporary workaround you can use the compatibility com.vaadin.v7.ui.NativeSelect but that requires the
compatibility packages as mentioned in docs