Skip to content

API for setting dropdown popup overlay width #2331

@mvysny

Description

@mvysny

Describe your motivation

In certain apps, certain ComboBoxes tend to have items with long texts. If the text won't fit the default dropdown popup width, the text will wrap, which is often not desired.

It would be good to have a means to override the dropdown width and specify an exact number in pixels.

This was filed as vaadin/vaadin-combo-box-flow#387 ; the issue was closed but not implemented since there's no Java API.

Describe the solution you'd like

I want to be able to call comboBox.setDropdownWidth("30em").

Additional context

Workaround/how this function should be implemented:

comboBox.getElement().getStyle().set("--vaadin-combo-box-overlay-width", width.trim())

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions