Events
| Property | Type | Description |
|---|---|---|
onChange | function | (optional) will be called on state changes made by the user. Returns an object with the new selected data item { data, event, attributes, value }. |
onSelect | function | (optional) will be called once the user focuses or selects an item by a click or keyboard navigation. Returns an object with the new selected data item { data, event, attributes, value, activeItem }. The activeItem property is the currently selected item by keyboard navigation. |
onShow | function | (optional) will be called once the user presses the dropdown. Returns the data item { data, attributes }. |
onHide | function | (optional) will be called once the user presses the dropdown again, or clicks somewhere else. Returns the data item { data, attributes }. |
The onChange vs onSelect difference
The difference between onChange and onSelect is:
onChangewill be called when the state changes, either with a click or space/enter keypress confirmation.onSelectdiffers most when the user is navigating by keyboard. Once the user is pressing e.g. the arrow keys, the selection is changing, but not the state.