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

Close button should be <button>, have accessible text. #260

Closed
mrwweb opened this issue Nov 15, 2016 · 7 comments
Closed

Close button should be <button>, have accessible text. #260

mrwweb opened this issue Nov 15, 2016 · 7 comments

Comments

@mrwweb
Copy link

mrwweb commented Nov 15, 2016

At present, the close button is just a <span>, so it can't have focus and therefore can't be navigated to with a keyboard. It should be made with a focusable element, probably a <button>. Further, that button needs a text label of some form. That could be done either with a span with class screen-reader-text or an aria-label attribute.

@marcandre
Copy link
Collaborator

👍, care to provide a PR?

@mrwweb
Copy link
Author

mrwweb commented Nov 16, 2016

Unfortunately, no. Sorry.

Given this, #259, and a tight project deadline, I needed to find a different accessible-out-of-the-box lightbox.

@marcandre
Copy link
Collaborator

Ok, let me see what I can come up with, then.

A <button> makes sense, but an <a> would make the CSS easier to reset... Any objection?

@mrwweb
Copy link
Author

mrwweb commented Nov 16, 2016

The general a11y rule is to use links for things that go to other pages (or page-like things) and buttons for actions. Therefore, a button is the preferable element.

@marcandre
Copy link
Collaborator

I agree. Just not sure I want to add rules like button::-moz-focus-inner to reset it. Let me try

marcandre added a commit that referenced this issue Nov 16, 2016
@marcandre
Copy link
Collaborator

Not so bad. Changed it to a <button>.

marcandre added a commit that referenced this issue Nov 16, 2016
@marcandre
Copy link
Collaborator

Fixed in 1.6.0

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

No branches or pull requests

2 participants