Open binarious opened 2 years ago
Workaround 1:
new autoComplete({
resultsList: {
element: (list, data) => list.setAttribute('aria-label', 'My Label');
}
});
Still results in axe
errors, because this only gets executed and added on focus.
Workaround/hack 2:
// after new autoComplete
const unlabelledListbox = document.querySelector('ul[role="listbox"]:not([aria-label])');
if (unlabelledListbox) {
unlabelledListbox.setAttribute('aria-label', 'My Label');
}
axe
throws the following error:The node:
[x] To Reproduce Run
axe
on an autocomplete element.[x] Expected behavior
axe
shouldn't throw an error/thelistbox
should have a label.