Skip to content

Commit

Permalink
Stop hidden anchors from being keyboard accessible
Browse files Browse the repository at this point in the history
As these have been given 'aria-hidden' to hide them from screen readers
we should also ensure that they cannot be tabbed to.

By adding 'tabindex=-1' we ensure that a screen reader user does not tab
to these and get no response.

Fixes #126
  • Loading branch information
NickColley committed Oct 18, 2019
1 parent 2fea563 commit 2c4ff7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/assets/javascripts/_modules/anchored-headings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var $this = $(this)
$this.addClass('anchored-heading')
$this.prepend(
'<a href="#' + $this.attr('id') + '" class="anchored-heading__icon" aria-hidden="true"></a>'
'<a href="#' + $this.attr('id') + '" class="anchored-heading__icon" aria-hidden="true" tabindex="-1"></a>'
)
}
}
Expand Down

0 comments on commit 2c4ff7e

Please sign in to comment.