Skip to main content

Dropdown

Dropdown component implements Drop-Down List, which is similar to html select in web. It's also known as non-editable ComboBox, in the reference implementation.

See also:

Features

  • A label to be associated with the dropdown, placed before or above the dropdown. See the spec.
  • Grouping options into sections (See "With sections" example below).
  • Invalid state (see "Validated" example below).

Live example

Result
Loading...
Live Editor

Label Alignment

Use LabeledControlsAlignmentProvider to align Dropdown with other labeled controls, according to the design guidelines.

Result
Loading...
Live Editor

Known differences

There are a few differences between Dropdown and (the reference implementation).

Sizing based on the options

Swing implementation of ComboBox sets the size of the combobox trigger based on the options. That requires calculating the size of the options before the dropdown menu is opened, which is not straightforward, and doesn't really seem necessary.

Selection change while navigating options

In the reference implementation, the selected value changes as you navigate through the options by keyboard. It's not the case however, when an option is focused by being hovered over with the mouse. Changing selected value when options are navigated by keyboard is not implemented due to the UX benefit not being clear and to avoid the imposed complications in the implementation.