solidjs / solid-router

A universal router for Solid inspired by Ember and React Router
MIT License
1.14k stars 147 forks source link

Current `aria-current` heuristics violate WAI-ARIA rules #289

Closed binyamin closed 8 months ago

binyamin commented 1 year ago

Describe the bug

Whenever the <A /> component is active, it adds aria-current="page" to the rendered element. Since this package defaults to only matching the beginning of the route, this violates WAI-ARIA for aria-current in two ways:

  1. There can only be one element marked as "current" within the set of elements. Currently, if I link to both / and /docs, they will both be marked as "current".
  2. The page value is meant to indicate the page that's currently displayed. Currently, if I'm viewing /docs/introduction, a link to /docs will be marked as "current".

Note: I don't have a stackblitz account, and I have plenty of GitHub repositories already. If you feel my description isn't clear, I can provide a gist.

Your Example Website or App

See above

Steps to Reproduce the Bug or Issue

See above

Expected behavior

See above

Screenshots or Videos

No response

Platform

Additional context

No response

binyamin commented 1 year ago

@ryansolid Do you need any more info?

ryansolid commented 10 months ago

I see that probably came from a PR. I haven't looked at this myself. Are you suggesting we just stop setting this property?

binyamin commented 10 months ago

Maybe. I see two options:

  1. Apply aria-current="page" as if the end property is specified. Meaning, the end property will only affect the class-names.
  2. Stop setting aria-current. As they say, "no ARIA is better than bad ARIA".
ryansolid commented 8 months ago

fix by #363