Document outline: Should be links not buttons #7142
Labels
[Focus] Accessibility (a11y)
Changes that impact accessibility and need corresponding review (e.g. markup changes).
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Milestone
Describe the bug
Anchor tags are not being used to structure the Document Outline functionality. Anchor tags are meant to lead to information on the same page or on another page and are the most suitable element to be used in this section.
We are emulating the hyperlink behaviour by moving keyboard (and viewport) focus to the relevant area, but the behaviour may be unpredictable to blind users (even with the help text).
To Reproduce
Steps to reproduce the behavior:
<button>
elements.Current Markup
<button class="document-outline__button"> <span class="document-outline__emdash" aria-hidden="true"></span> <strong class="document-outline__level">Title</strong> <span class="document-outline__item-content">Gutenberg, imagine the possibilities</span> <span class="screen-reader-text">(Click to focus this heading)</span> </button>
Expected behavior
As a blind user of a screen reader, I would expect that hyperlinks lead to somewhere (and the focus will be moved there), and I would expect the behaviour of buttons to be less predictable in general.
Expected Markup
<a class="document-outline__button" href="..."> <span class="document-outline__emdash" aria-hidden="true"></span> <strong class="document-outline__level">Title</strong> <span class="document-outline__item-content">Gutenberg, imagine the possibilities</span> <span class="screen-reader-text">(Click to focus this heading)</span> </a>
Desktop (please complete the following information):
However this issue is not specific to a browser.
Additional context
The text was updated successfully, but these errors were encountered: