-
Notifications
You must be signed in to change notification settings - Fork 853
[EuiPagination][A11y] Prevent duplicate aria-label
#8521
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
Comments
I looked into how the pagination is constructed in different places, including:
In majority, they use Looking at the common requirements:
Code example: <nav aria-label="Pagination">
<ul>
<li><a href="/blog">1</a></li>
<li aria-current="page">2</li>
<li><a href="/blog?p=3">3</a></li>
</ul>
</nav> EUI markup
<nav>
<span aria-atomic="true" aria-relevant="additions text" role="status">Page 6 of 10</span>
<button type="button" aria-label="Previous page" title="Previous page" data-test-subj="pagination-button-previous">
<svg />
</button>
<ul>
<li>
<button type="button" aria-label="Page 1 of 10" data-test-subj="pagination-button-0">
<span>
<span>1</span>
</span>
</button>
</li>
<li aria-label="Skipping pages 2 to 3">…</li>
<li>
<button type="button" aria-label="Page 4 of 10" data-test-subj="pagination-button-3">
<span>
<span>4</span>
</span>
</button>
</li>
<li>
<button type="button" aria-label="Page 5 of 10" data-test-subj="pagination-button-4">
<span>
<span>5</span>
</span>
</button>
</li>
<li>
<button disabled type="button" aria-label="Page 6 of 10" data-test-subj="pagination-button-5" aria-current="true">
<span>
<span>6</span>
</span>
</button>
</li>
<li>
<button type="button" aria-label="Page 7 of 10" data-test-subj="pagination-button-6">
<span>
<span>7</span>
</span>
</button>
</li>
<li>
<button type="button" aria-label="Page 8 of 10" data-test-subj="pagination-button-7">
<span>
<span>8</span>
</span>
</button>
</li>
<li>
<button type="button" aria-label="Page 9 of 10" data-test-subj="pagination-button-8">
<span>
<span>9</span>
</span>
</button>
</li>
<li>
<button type="button" aria-label="Page 10 of 10" data-test-subj="pagination-button-9">
<span>
<span>10</span>
</span>
</button>
</li>
</ul>
<button type="button" aria-label="Next page" title="Next page" data-test-subj="pagination-button-next">
<svg />
</button>
</nav> Proposed solution: Remove |
@weronikaolejniczak Great detailed summary of your research! |
Description
relates to elastic/kibana#214104
Currently
EuiPagination
uses the samearia-label
for it'snav
(code) andul
(code) elements due to spreading the props tonav
. This results in a duplicated output in screen readers.We should instead limit the
aria-label
to thenav
element or check if we need to support a standalonearia-label
fornav
andul
.The text was updated successfully, but these errors were encountered: