Skip to content
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

Add explicit aria-label to placeholder-only inputs #22321

Merged
merged 3 commits into from
Apr 9, 2017
Merged

Add explicit aria-label to placeholder-only inputs #22321

merged 3 commits into from
Apr 9, 2017

Conversation

patrickhlauke
Copy link
Member

While placeholder is nominally valid per spec
http://rawgit.com/w3c/html-api-map/master/index.html#accessible-name-and-description-calculation
it is inelegant, a fallback, and not supported in ios/safari/voiceover
and android/chrome/talkback, to name a few combinations

aria-describedby is also not really the right tool for providing a
name/label equivalent, so remove that from the list of possible
alternative methods / clarify how it can be used

closes #22302

While `placeholder` is nominally valid per spec
http://rawgit.com/w3c/html-api-map/master/index.html#accessible-name-and-description-calculation
it is inelegant, a fallback, and not supported in ios/safari/voiceover
and android/chrome/talkback, to name a few combinations

`aria-describedby` is also not really the right tool for providing a
name/label equivalent, so remove that from the list of possible
alternative methods / clarify how it can be used
@patrickhlauke
Copy link
Member Author

xref w3c/html-aam#84 - in theory, IF iOS/VO and Android/Chrome/TalkBack fix their bugs, this PR's main change (adding extra aria-label) may be superfluous...but right here, right now, it's needed for these platforms (and even once fixed it's not actually wrong to have aria-label explicitly, just perhaps a bit "belt and braces" redundancy)

@patrickhlauke patrickhlauke added this to the v4.0.0-beta milestone Apr 9, 2017
@patrickhlauke patrickhlauke merged commit 0af28c2 into twbs:v4-dev Apr 9, 2017
@mdo mdo mentioned this pull request Apr 9, 2017
@patrickhlauke
Copy link
Member Author

adding to this: since I raised UA inconsistencies, it's now been officially decided to remove placeholder from the official "accessible name calculation" algorithm in HTML. user agents may still do this, but it's outside of spec, and won't be guaranteed to work cross-browser. in short: this PR was the right call w3c/html-aam#87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants