-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency in allowed uses of placeholder and aria-placeholder #2347
Comments
i just checked chrome/edge dev tools and re: the example code provided, the placeholder is shown but crossed out in the dev tools. But, in testing with jaws, nvda and narrator the placeholder works just fine. Maybe more an issue with chrome dev tools than an actual issue with implementations? I also modified the example code to use aria-placeholder instead of placeholder, and "yummy" was exposed by all screen readers for that variant. In firefox, the placeholder is exposed in the a11y tree view just fine and worked without issue. So not sure why we are seeing different things there. The issue i see here is that a spinbutton and a combobox in ARIA don't necessarily need to be rendered as editable text fields. A select, for instance, on Windows is exposed as a combobox as well, but there's no allowance for the placeholder attribute there. So maybe an acknowledgement that if these roles are rendered as editable text fields, aria-placeholder could be used. Again it doesn't seem like there are actual implementation issues in my quick testing... so maybe this issue is really more for clarification for developers (and i assume a11y checkers so as to not throw false positives). |
On Windows at least there's 2 kinds of comboboxes: editable and non-editable. The editable ones have an edit box (which displays the placeholder) and a dropdown list (like https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.combobox?view=winrt-26100 I think the issue partly stems from the fact there are 2 different types of comboboxes, but aria-placeholder only makes sense for one of these types. |
yes. that's what i already mentioned. |
Yep, for our purposes (updating the RNC schemas for validator.w3.org/nu) all we'd need is If this goes into ARIA 1.3 we'd need to figure out what to do about it in the current VNU before 1.3 becomes a REC (maybe just issuing a warning rather than an error when aria-placeholder is used on combobox/spinbutton is the way to go).
Probably not necessary for our purposes, but it's not clear from the description of combobox how AT actually figures out whether a combobox is editable, since there are multiple ways to implement the edit box portion (e.g .input type=text, textarea rows=1, contenteditable or a custom-element). Chrome treats a combobox using input/textarea/contenteditable as an editable combobox. Firefox only treats input/textarea as an editable combobox (contenteditable with role=combobox is not reported as editable in the FF a11y inspector). Not tried custom elements but guessing that even if they do work, there will be differences between custom elements inheriting from input/textarea and autonomous custom elements (not even sure how an autonomous custom element could communicate that it's editable). |
There's an inconsistency between where aria-placeholder is allowed in ARIA and where placeholder is allowed in HTML.
ARIA 1.2 (and the current working draft) only allows
aria-placeholder
onHTML allows the
placeholder
attribute in places that map to additional roles:input type=text
which has an implicit textbox roleinput type=text
with alist
attribute which has an implicit combobox roleinput type=search
which has an implicit searchbox roleinput type=search
with alist
attribute which has an implicit combobox roleinput type=number
which has an implicit spinbutton rolehttps://html.spec.whatwg.org/multipage/input.html#input-type-attr-summary
You can see this happening here - there's a visible placeholder (Yummy), but in Chrome and Firefox DevTools it's not exposed anywhere in the accessibility info:
The text was updated successfully, but these errors were encountered: