handleSpaceKey method

  1. @override
void handleSpaceKey(
  1. KeyboardEvent event
)
override

Toggle an active list item in multi-select comboboxes.

Type a space into the search box in all other cases including a multi-select input with no active item.

Implementation

@override
void handleSpaceKey(html.KeyboardEvent event) {
  if (!showPopup || !isMultiSelect) return;

  final item = activeModel.activeItem;
  if (item == null || isOptionDisabled(item)) return;

  onListItemSelected(item);
  event.preventDefault();
}