Skip to content
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

aria-current in NavLink #4707 #4708

Merged
merged 1 commit into from Jul 5, 2017
Merged

Conversation

JasonEtco
Copy link
Contributor

Line 32 has to be aria-current instead of ariaCurrent, otherwise React will strip it out.

Line 32 has to be `aria-current` instead of `ariaCurrent`, otherwise React will strip it out.
@timdorr
Copy link
Member

timdorr commented Apr 11, 2017

This seems sensible to me, but I'm not an a11y expert. Maybe @ryanflorence would know more?

@afercia
Copy link

afercia commented Jun 6, 2017

It would be great to have this in 🙂 Maybe I can help with some references:

Using the aria-current attribute - by Léonie Watson, January 14th 2017
http://tink.uk/using-the-aria-current-attribute/

Linked on that post: Examples and support as of January 2017 (actually, I see now they updated the support matrix)
https://ljwatson.github.io/design-patterns/aria-current/

With the release of NVDA 2017.2 a few days ago, three of the major screen readers, in combination with different browsers, have full support for aria-current:
https://www.nvaccess.org/post/announcing-nvda-2017-2-release/

}

NavLink.defaultProps = {
activeClassName: 'active'
activeClassName: 'active',
ariaCurrent: 'true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be page by default? That seems to be the most common use case within a routing library.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested true because it's the least specific (and therefore the most widely applicable) value, but you could be right. My thought was that in some cases, it's not a page that's active like in the case of a nested route (think an onboarding flow that might have multiple steps in one similar view, ergo step).

Totally open to some more informed opinions of course, I'm just speculating.

@afercia
Copy link

afercia commented Jun 7, 2017

Testing with Safari + VoiceOver, here's the difference between true and page. Other screen readers might use a different wording.

screen shot 2017-06-07 at 08 39 05

screen shot 2017-06-07 at 08 39 44

@timdorr
Copy link
Member

timdorr commented Jul 5, 2017

Well, if people don't like it, it can be overridden pretty easily. Thanks!

@timdorr timdorr merged commit 89093a4 into remix-run:master Jul 5, 2017
@JasonEtco JasonEtco deleted the patch-1 branch July 5, 2017 20:12
li-kai added a commit to nusmodifications/nusmods that referenced this pull request Dec 22, 2017
* Update packages to react 16

* Upgrade Flow to v0.61.0

* Fragment ALL the things

* Use ariaCurrent and refactor navlink props

- See: remix-run/react-router#4708
  and https://tink.uk/using-the-aria-current-attribute/

* Update more dependencies

* Extract dom mock code to test utils

* Remove window.requestAnimationFrame from mocks

* Fix lint
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants