-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix the '+(xx) others' link losing focus after activation #3192
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I have a couple questions
- The button disappears when the content is expanded - is this correct? Could this confuse users into not knowing if the button has been expanded, as it no longer exists after interacting with it?
- Should the button have an
aria-controls
on it as well, like our accordion component does?
@AshGDS, thanks for the comments
I agree, it's a strange pattern. However, the requirement for this work is just to fix a problem with lost focus once the button is removed. As there is a task on the Trello card to review this pattern for a refactor, I think it's best not to confuse the issue as part of this work.
I'm not sure. My accessibility knowledge on that is not extensive, but reading up on |
d8e6c6f
to
809b7bf
Compare
@AshGDS I've added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - a small change needed but looking good
Reported as an issue in JAWS, and also further observed as problematic in other screen-readers, this issue was actually a problem for all users as it did not focus a relevant element after activation. I've now changed the behaviour: * Anchor element is replaced with a button for improved accessibility * Button inherits parent styles to appear like a link * After activation, focus the first link in the now-visible links panel
809b7bf
to
33ee2ec
Compare
What/Why
From Trello:
When using the ‘+ 12 others’ link with JAWS, the focus is lost. Using the tab key gets you to the first inserted link. But when navigating ‘in context’, using arrow keys to read through the page, the focus for JAWS users gets moved back to the start of the page which causes them to lose their place.
More info
This was reported as an issue in JAWS. After testing, I also observed this as a problem in other screen-readers. However, this issue was potentially a problem for all users as it did not focus a relevant element after activation. It would be confusing for non-screen-reader users who use the keyboard to navigate.
The behaviour has now changed:
Styling modified:
I've tested this extensively in Assistiv Labs using JAWS, NVDA and Talkback and the behaviour now seems consistent:
Follow these steps if you are doing a Rails upgrade.