w3c/aria

Clarify `aria-autocomplete` and `autocomplete` semantic equivalency

tay1orjones opened this issue · 3 comments

Describe your concern

I've been reading through the specs regarding these two attributes and can't clearly identify if aria-autocomplete is semantically equivalent to HTML's autocomplete. I see a significant number of implementations of ComboBoxes using autocomplete="off" to instruct the browser to not use it's native autofill functionality (despite sometimes not being respected like in chrome). They additionally use aria-autocomplete="list" on the same element to convey the usage/presence of a custom listbox.

Is it an acceptable practice to use both aria-autocomplete and autocomplete on a ComboBox and other elements/widgets, or should only one of these be used?

Link to the version of the specification or documentation you were looking at at.

Does the issue exists in the editors draft (the editors draft is the most recent draft of the specification)?

Yes

Related: w3c/aria-practices#639

pkra commented

Just to add: https://w3c.github.io/html-aam/#att-autocomplete-form says

If the element includes both autocomplete and aria-autocomplete attributes with valid values, User Agents MUST expose only the autocomplete attribute value.

there is overlap, but they aren't entirely equivalent.

also from HTML AAM:

Note: the ARIA attribute and the HTML attribute have disparate features.

there may need to be some more nuance to that user agents MUST in html aam... the intent there was likely to handle situations like <input autocomplete=name aria-autocomplete=inline | none> where the aria version is implying there's an inline autocomplete (type ahead) or no autocomplete, but the HTML attribute would render the browser's popup of saved names (a an autocomplete list).

but, to the point of the OP, <input role=combobox aria-autocomplete=list autocomplete=off ...> wouldn't be right - because there we do want a list to display, just not the browser's list (though lol, some browsers still going to show their autocomplete popup regardless - regardless of if a dev or user wants it to show or not)