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

Set aria-labelledby & id attributes via JS #19

Closed
Schepp opened this issue Apr 25, 2013 · 2 comments
Closed

Set aria-labelledby & id attributes via JS #19

Schepp opened this issue Apr 25, 2013 · 2 comments

Comments

@Schepp
Copy link
Contributor

Schepp commented Apr 25, 2013

Although it is nice to have that extra a11y piece in place I would suggest setting aria-labelledby and the corresponding id on a dialog's header part via JavaScript.

Why? I expect most people to copy & paste dialog code and to forget to adjust id and aria attributes accordingly. Also I suspect most users of your modal lib will not have the background needed to identify this problem.

By moving this part to JS you ensure a much better a11y across the board.

@anselmh
Copy link
Contributor

anselmh commented Apr 25, 2013

I vote against. This is unexpected behavior for the user and should not be done in js. If aria is not used by developers this is a different problem which should be tackled other way.

@drublic
Copy link
Owner

drublic commented Apr 25, 2013

Good points, @Schepp. Actually I think it is worth including a short note about changing the aria-labelledby in the How To Markup section.
I don't think it is necessary to include this as a JS method, users might remove the label's id anyway if they don't need them.

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

No branches or pull requests

3 participants