-
Notifications
You must be signed in to change notification settings - Fork 795
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
Placeholder does not get recognized as label #2413
Comments
Thanks for the issue. Tested in Safari/VO, IE11/JAWS, and Firefox/NVDA and all use the placeholder for the accessible name. Also confirmed in the accessible name computation spec. |
I'd like to see Chrome+JAWS too, if it works there (in addition to the above, I agree we should add it in. I had no idea this was spec'ed. I heard when this went into Firefox, wasn't supported anywhere else at the time. Pretty surprised it works in IE. |
Confirmed in Chrome/JAWS <input placeholder="foo bar baz"> "foo bar baz edit, foo bar baz typeof text" |
alrighty, lets add placeholder to accessibleText |
Don't agree with that label. This is a false positive. |
This one seems to be a bit more complex - although placeholder is accessible to assistive tech, it may be having other problems when used in combination - without visible label for example. So I guess it is not enough to only say it is a false positive. This article describes the details that I think we should consider: https://www.deque.com/blog/accessible-forms-the-problem-with-placeholders/ Is it possible to make the rule a bit more context aware? I think it has to be, to really give correct answer... Something in this direction:
This change can in my opinion encourage bad practice of using only a placeholder for inputs and should probably be investigated with context in mind. |
Whether a placeholder is advisable or not (please don't), the feedback from Axe is a false positive in the context of WCAG. When contrast is an issue, it should report that. |
That's why I am against your suggestion in the first place - "please don't will soon be forgotten" as multiple users will argue that automatic tools don't report it as an issue, I am afraid. It has the potential to encourage bad practices because it can be interpreted as if placeholder alone is enough. But it is not - in my opinion - because it can not guarantee a "persistent" label (in this case for sighted users). This suggestion will allow a form with no "real" labels - for example made only of inputs with placeholders which would then fail Success Criterion 3.3.2: Labels or Instructions; https://www.w3.org/WAI/WCAG21/Understanding/labels-or-instructions.html (when field is filled there is no way to see the label). Imagine a form of 10+ fields with only placeholders as hints for the inputs. So - I must oppose this suggestion if it is not at the same time also verifying presence of the alternative - visible - label. I guess this issue should at least be discussed more widely in the accessibility community before just accepting that placeholder alone is suitable for all users. |
The <input autocomplete="Search query" />
<button>search</button> |
OK, I get all the points made here, but I still can not agree with it as it will most probably encourage (even more) "placeholder abuse" if it will not consider the context around elements as well. Assistive tech. reading the placeholder as label is one thing but then again, using placeholder as only "label" will not be accessible for sighted users with for example short memory problems. I do not have any mandate here and so I can just hope that this change will not bring more harm to accessibility with allowing labels that are actually not accessible to all users (without context) to be treated as such. |
No docs required |
Hey (disclaimer: #a11y newbie here ;-)), just a quick question regarding this: Do I understand it correctly that axe does not perform an additional check for "Success Criterion 3.3.2: Labels or Instructions; https://www.w3.org/WAI/WCAG21/Understanding/labels-or-instructions.html (when field is filled there is no way to see the label)." as @BogdanCerovac pointed out? Demo: https://cdpn.io/mandrasch/debug/OJWOXbX/ZorBaLWLzjbM No error on axe, WAVE: (As I would expect it for WCAG testing) Thanks in advance! |
@mandrasch please ask questions like this in the axe Community Slack, the short answer is "no" for axe-core, but "yes" for the axe Pro Forms tool -> https://axe.deque.com/ |
Expectation: An
<input>
with a placeholder-attribute does not get recognized as having an accessible nameActual: When I run aXe on FireFox at https://app.element.io/#, I get a violation on the search input. The input has a placeholder which should create an accessible name. Both FireFox and Chrome use this to create an accessible name, but aXe does not.
<input type="text" class="mx_RoomSearch_input" placeholder="Search" autocomplete="off" value="">
aXe still gives the violation "Form elements must have labels".
Motivation: It looks like a false positive.
The text was updated successfully, but these errors were encountered: