accessibleItemActivation property
Implementation
bool get accessibleItemActivation => _accessibleItemActivation;
Whether suggestions should be smartly activated / highlighted.
Defaults to true.
When true:
-
If selection has selected values, the first selected value in options is activated / highlighted when the suggestions list opens. Justification - "If one or more options are selected before the listbox receives focus, focus is set on the first option in the list that is selected". https://www.w3.org/TR/wai-aria-practices/#Listbox
-
If selection is empty, the first value in options is activated / highlighted when the suggestions list opens. Justification - "If none of the options are selected before the listbox receives focus, focus is set on the first option...". https://www.w3.org/TR/wai-aria-practices/#Listbox
-
If selection is a MultiSelectionModel, deactivate any active suggestions when the search text changes. This does not apply for any text changes caused by shouldClearInputOnSelection or when the suggestions list opens. Justification - The W3 listbox spec (see above for link) says that
When false:
-
if selection isSingleSelect, don't auto activate / highlight any options.
-
if selection isMultiSelect, activate / highlight the first value when the suggestions list opens. Also, do not clear the active item when the search text changes.
Implementation
@Input()
set accessibleItemActivation(bool value) {
_accessibleItemActivation = value;
activeModel.activateFirstItemByDefault =
(isSingleSelect && value) || (isMultiSelect && !value);
}