Dojo's List
provides a base widget that can be used as a List or an options List within a Select
, Typeahead
, etc.
- Handles keyboard interactions if given focus
- Can be controlled through
activeIndex
andonActiveIndexChange
in conjunction withfocusable: false
. - Handles native style scrolling
- Provides a custom renderer for more complex List items
- Active selection follows mouse as per native behavior
List
supports keyboard navigation for highlighting and selecting options.
- Enter Key: selects the current option
- Space Key: selects the current option
- Up Arrow: highlights the previous option
- Down Arrow: highlights the next option
- a-z, 0-9: highlights matching entries, ie.
ne
would matchnevada
in a list of states.
When using a custom renderer, the ListItem
widget supports different child properties.
- Leading: Content to display at the start of the list item, such as an icon
- Primary: Main content of the list item
- Trailing: Content to display at the end of the list item, such as minor details