Skip to content

Commit

Permalink
Docs: accessibility and IE fixes for SVG-based top navigation (#22848)
Browse files Browse the repository at this point in the history
* Add explicit aria-label attributes to <svg> based links

As some browser/AT combinations don't seem to fully support grabbing the
`<title>` from inside the `<svg>` as the link text/name to announce
(e.g. Firefox+NVDA)

* Add <title> to Bootstrap logo <svg>

* Add <title> to menu <svg>

* Add explicit focusable="false" to <svg> icons

Due to a bug/"feature" in IE, `<svg>` elements are usually separately
focusable, which then results in links with `<svg>` icons being
essentially focused twice (once for the link, and once for the `<svg>`
inside, which is then also non-interactive)
  • Loading branch information
patrickhlauke authored Jun 17, 2017
1 parent 9f09290 commit 816d5bd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions _includes/docs-navbar.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<header class="navbar navbar-inverse navbar-expand-md flex-column flex-md-row bd-navbar">
<a class="navbar-brand mr-0 mr-md-2" href="{{ site.baseurl }}/">
<a class="navbar-brand mr-0 mr-md-2" href="{{ site.baseurl }}/" aria-label="Bootstrap">
{% include icons/bootstrap.svg width="36" height="36" class="d-block" %}
</a>

Expand Down Expand Up @@ -43,17 +43,17 @@
</li>

<li class="nav-item">
<a class="nav-link p-2" href="{{ site.repo }}" target="_blank">
<a class="nav-link p-2" href="{{ site.repo }}" target="_blank" aria-label="GitHub">
{% include icons/github.svg class="navbar-nav-svg" %}
</a>
</li>
<li class="nav-item">
<a class="nav-link p-2" href="https://twitter.com/{{ site.twitter }}" target="_blank">
<a class="nav-link p-2" href="https://twitter.com/{{ site.twitter }}" target="_blank" aria-label="Twitter">
{% include icons/twitter.svg class="navbar-nav-svg" %}
</a>
</li>
<li class="nav-item">
<a class="nav-link p-2" href="{{ site.slack }}" target="_blank">
<a class="nav-link p-2" href="{{ site.slack }}" target="_blank" aria-label="Slack">
{% include icons/slack.svg class="navbar-nav-svg" %}
</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion _includes/icons/bootstrap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion _includes/icons/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion _includes/icons/menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion _includes/icons/slack.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion _includes/icons/twitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 816d5bd

Please sign in to comment.