jw-react-pagination icon indicating copy to clipboard operation
jw-react-pagination copied to clipboard

Component uses Anchors with no href Attribute

Open jlazarski opened this issue 6 years ago • 1 comments

Due to the use of the tag with no href in the component, the console is marked with a few warnings about accessibility. I realize this is just a warning and is being caused by a linting plugin but wanted to mention it. Here is the warning being seen:

The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md jsx-a11y/anchor-is-valid

jlazarski avatar Jan 04 '19 05:01 jlazarski

Glad to see this issue! I ran into this today because it creates a huge problem for keyboard-only users. If you're looking for compliance, this is a WCAG Level A failure (2.1.1). The pagination links are skipped over entirely (can't be reached) when a person tabs from interactive component to interactive component.

My first reaction is to change it to a button if it's dynamically changing a component on the page. If it's actually given a path to lead to another page, then a href is appropriate.

digilou avatar Aug 09 '21 22:08 digilou