var itemId = state.selectionId + '-' + index;
// Deselect all the selections.
- selectionElement.children().attr('data-active-selection', false).attr('id', '');
+ selectionElement.children().attr('data-active-selection', null).attr('id', '');
+
// Select only this suggestion and assign it the id.
element.attr('data-active-selection', true).attr('id', itemId);
+
// Tell the input field it has a new active descendant so the item is announced.
selectionElement.attr('aria-activedescendant', itemId);
// Find the list of selections.
var selectionsElement = $(document.getElementById(state.selectionId));
// Find the active one.
- var element = selectionsElement.children('[data-active-selection=true]');
+ var element = selectionsElement.children('[data-active-selection]');
if (!element) {
return activateSelection(0, state);
}
var selectionsElement = $(document.getElementById(state.selectionId));
// Find the active one.
- var element = selectionsElement.children('[data-active-selection=true]');
+ var element = selectionsElement.children('[data-active-selection]');
var current = 0;
if (element) {
// Find the list of selections.
var selectionsElement = $(document.getElementById(state.selectionId));
// Find the active one.
- var element = selectionsElement.children('[data-active-selection=true]');
+ var element = selectionsElement.children('[data-active-selection]');
if (!element.length) {
return activateSelection(0, state);
}
case KEYS.SPACE:
case KEYS.ENTER:
// Get the item that is currently selected.
- var selectedItem = $(document.getElementById(state.selectionId)).children('[data-active-selection=true]');
+ var selectedItem = $(document.getElementById(state.selectionId)).children('[data-active-selection]');
if (selectedItem) {
e.preventDefault();