Open uiu490 opened 1 year ago
Note that removing the href
also removes any default keyboard interactivity, making it easy to mess up keyboard accessibility. Generally I would not recommend removing it and if there is no suitable href
in the first place, maybe a <button>
would be more appropriate.
I’m not building this site, the anchor tag is chosen for styling purposes, you’ll get the missing attribute error for an anchor without an href, but there shouldn’t be a redundant role error because the anchor tag without the href does not have a semantic role in HTML5.
Describe the bug
The a11y-no-redundant-roles warning correctly identifies that < a href="http://somelink.com" role="link"> has a redundant role because an anchor tag with an href has an implicit role (link) in HTML5. However, the redundant role warning should not appear when < a role="link"> html is used, because HTML5 does not implicitly assign the link role to anchor tags without hrefs.
Reproduction
"< a role="link"></ a>"
A11y: Redundant role 'link' svelte(a11y-no-redundant-roles)
Logs
No response
System Info
Severity
annoyance