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

fix(theme): Use aria-label alongside title #568

Merged
merged 1 commit into from
Jan 27, 2018
Merged

fix(theme): Use aria-label alongside title #568

merged 1 commit into from
Jan 27, 2018

Conversation

sorin-davidoi
Copy link
Contributor

Tested this on macOS with VoiceOver, and it does not pick up the title as the text of the button. Kind of makes sense, since title and aria-label are not the same. This will make sure that the buttons and links are labeled properly.

Tested this on macOS with VoiceOver, and it does not pick up the title as the text of the button. Kind of makes sense, since title and aria-label are not the same. This will make sure that the buttons and links are labeled properly.
@sorin-davidoi sorin-davidoi changed the title fix(theme): Use aria-label alonside title fix(theme): Use aria-label alongside title Jan 22, 2018
Copy link
Contributor

@Michael-F-Bryan Michael-F-Bryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me. I had a question on how changing from <button> to <i> will affect its behaviour though.

@@ -172,7 +172,7 @@ function playpen_text(playpen) {

var buttons = document.createElement('div');
buttons.className = 'buttons';
buttons.innerHTML = "<i class=\"fa fa-expand\" title=\"Show hidden lines\"></i>";
buttons.innerHTML = "<button class=\"fa fa-expand\" title=\"Show hidden lines\" aria-label=\"Show hidden lines\"></button>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't using a proper <button> here instead of an <i> mean it becomes something clickable with the usual 3D depression effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it looks the same but it becomes focusable. The other buttons were changed in the remove jQuery pull request, but I've somehow missed this one.

@Michael-F-Bryan Michael-F-Bryan merged commit 674e58e into rust-lang:master Jan 27, 2018
@sorin-davidoi sorin-davidoi deleted the fix-a11y branch January 27, 2018 12:01
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this pull request Aug 30, 2020
Tested this on macOS with VoiceOver, and it does not pick up the title as the text of the button. Kind of makes sense, since title and aria-label are not the same. This will make sure that the buttons and links are labeled properly.
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

Successfully merging this pull request may close these issues.

2 participants