-
-
Notifications
You must be signed in to change notification settings - Fork 78.5k
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
Accessibility problems with pagination controls #40579
Comments
They're controls that navigate you to another page. So (unless you're using the component but hijacking it to use JS to provide in-page dynamic changes) links are the most appropriate element to use.
True, links don't have the same mechanism as a button/form control. But generally, a "disabled" link is simply text that is non-focusable and non-interactive.
if you want to provide more context, the mechanisms there are exactly the same as for buttons - for instance, adding explicit In this case, they are changing the behaviour here - they're not links anymore, but in their case they should indeed replace them with buttons.
then ARC toolkit is wrong, because anchors without
this wouldn't be any different if you swapped them out for buttons. unless the author provides some context (for instance, by adding an explicit
the documentation should probably explain that authors should adapt the pattern if they're planning to make it do stuff dynamically on-page (and use |
I think the problem with saying buttons with the pagination classes are appropriate in some situations is that the layout doesn't work ideally. At least in my limited testing trying to convert the pagination example code to buttons just ended up with a bunch of buttons (with all 4 corners radiused) bunched together instead of appearing like a button group. |
Hi! DataTables author here. I used I've had that piece of feedback a number of times - I think it is noted by automated tests such as ARC. I don't immediately recall anyone explicitly saying they use a screenreader and it was causing them problems. |
You sure? from my testing (just quickly replacing the |
Ah, nice! I overthought it and added "btn" to the class list when I did my test. |
…ol, as they are more suitable for in page nagivation and Bootstrap fully supports this. https://datatables.net/forums/discussion/79269 twbs/bootstrap#40579
Prerequisites
Describe the issue
Pagination controls use anchor elements instead of buttons which leads to accessibility issues. Anchor elements don't easily support being disabled and it is harder to provide context with them (meaning "1" for a page number doesn't meaningfully convey what it does to a screen reader). Button elements would be a lot easier to work with to convey the correct meaning for the various elements of the pagination control.
Reduced test cases
https://datatables.net/examples/styling/bootstrap5.html
ARC toolkit complains about the lack of href attributes on the disabled pagination links. JAWS does not provide any context on the page number links.
The author of DataTables suggested I come here for feedback because he is just following your example on how to use the pagination control.
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
5.3.3
The text was updated successfully, but these errors were encountered: