TarekRaafat / autoComplete.js

Simple autocomplete pure vanilla Javascript library.
https://tarekraafat.github.io/autoComplete.js
Apache License 2.0
3.93k stars 236 forks source link

aria-autocomplete="both" not allowed #288

Closed binarious closed 2 years ago

binarious commented 2 years ago

axe throws the following error:

Elements must only use allowed ARIA attributes Fix any of the following: ARIA attribute is not allowed: aria-autocomplete="both"

The node:

<input 
    type="text" 
    id="zip" 
    name="zip" 
    required="required"
    class="form-control" 
    maxlength="5" 
    role="search" 
    aria-describedby="addressInfo" 
    value="26125" 
    aria-controls="autoComplete_list_1" 
    aria-autocomplete="both"
>

Maybe it's because aria-autocomplete="both" requires aria-haspopup:

If an element has aria-autocomplete set to list or both, authors MUST ensure both of the following conditions are met: [...]

  1. The element has a value for aria-haspopup that matches the role of the element that contains the collection of suggested values.
binarious commented 2 years ago

Manually added aria-haspopup="listbox", but that didn't resolve the error, but changing the role from search to textbox or searchbox fixes this error.

binarious commented 2 years ago

role="search" wasn't produced by this package. Sorry.