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

Fixes for aria-live region #3781

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

Malgalad
Copy link

@Malgalad Malgalad commented Sep 27, 2019

A11y implementation fixes based on #3353 (comment).

  • aria-live region is rendered in the DOM since the beginning
  • aria-live region is not re-rendered, only its content changes
  • aria-atomic="true" is required for NVDA+FF so that screen reader reads the whole region and not just changed characters
  • aria-relevant="additions text" is, in theory, a default value if not specified, however, it doesn't work unless actually specified
  • unique keys for paragraphs are for fixing a bug with screen reader reading updates twice. After looking through the similar issues, I've come to the following possible explanation: browser updates text in 2 nodes, so two "text changed" updates are dispatched and screen-reader announces region text twice; with unique keys React remounts nodes instead of updating text inside, so only one update "two new nodes added" is dispatched (and "two old nodes removed" is ignored due to aria-relevant)

Also may fix #2937, #3675

@forgo
Copy link

forgo commented Oct 15, 2019

Looking forward to this fix! =)

@anthonyvialleton
Copy link

anthonyvialleton commented Mar 9, 2020

@Malgalad Any news about this PR?

Actually I also found that renderLiveRegion from :

<A11yText aria-live="polite">
<p id="aria-selection-event">&nbsp;{this.state.ariaLiveSelection}</p>
<p id="aria-context">&nbsp;{this.constructAriaLiveMessage()}</p>
</A11yText>
is responsible for W3C validation to break because of a span element wrapping the 2 p.

Could we change the p by spans instead?

Edit : I opened a dedicated PR for that case (see: #3964)

@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2020

🦋 Changeset detected

Latest commit: c144c9e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Malgalad
Copy link
Author

@anthonyvialleton I'm assuming the ball is in the @JedWatson's court. Updated the PR with your suggestions.

@anthonyvialleton
Copy link

@Malgalad It was not needed, as mentioned I already created a PR for that specifically ;)

@AaronV
Copy link

AaronV commented Mar 25, 2020

Hi @Malgalad, I'm really grateful that you've put this work in on this! I had been trying to wrap custom-components with the necessary pieces to properly support aria and wcag, but no luck so far. Getting proper JAWS support is important to me.

I'd like to try out your PR in my project but am having trouble installing the module and getting it to run.

I've installed the module using yarn, and it appears in my dependencies as "@react-select/monorepo": "https://github.com/Malgalad/react-select.git",.
I'm trying to import the package using import Select, { components } from '@react-select/monorepo/packages/react-select';

But I'm guessing I've missed some sort of build-step. I didn't see, in the docs, how to go about doing that. Can you help point me in the right direction?

@bladey bladey added pr/needs-review PRs that need to be reviewed to determine outcome pr/priority PRs that should be addressed sooner rather than later and removed ready-for-review labels May 26, 2020
@bladey bladey added category/accessibility Issues or PRs related to accessibility pr/bug-fix PRs that are specifically addressing a bug labels Jun 4, 2020
@agonzalezcr
Copy link

is there another possible solution for this issue besides waiting until this merge?
Thanks

@bladey bladey added pr/needs-review PRs that need to be reviewed to determine outcome and removed pr/needs-review PRs that need to be reviewed to determine outcome labels Aug 24, 2020
@asharron
Copy link

Is there anything I can do to help get this through? 🙂

I think this may include some fixes for some issues I'm seeing with Jaws, so would be happy to help in anyway I can

@Methuselah96
Copy link
Collaborator

Methuselah96 commented Nov 14, 2020

I've started a fork of react-select. Feel free to resubmit this PR on the fork and we can get it merged and released.

EDIT: 🎉 I've archived the fork now that we've got some momentum in this repo and Jed is involved again. Sorry for the disturbance!

@ebonow
Copy link
Collaborator

ebonow commented Dec 12, 2020

Greetings,
Thank you for contributing this and your patience. It is on our radar and we're also looking at #4161 for consideration and it appears there may be some merge conflicts.

Does anyone have concerns or an idea about what a proper merge would look like so we can include this in a near future release?

@ebonow ebonow added this to the 3.2 milestone Dec 22, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 13, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c144c9e:

Sandbox Source
react-codesandboxer-example Configuration

Copy link
Collaborator

@Methuselah96 Methuselah96 left a comment

Choose a reason for hiding this comment

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

@Malgalad Thanks for the PR! The unit tests are failing at the moment because they use enzyme which was removed in #3989. Can you update the tests to use @testing-library/react instead of enzyme when you get a chance?

@JedWatson JedWatson modified the milestones: 3.2, 3.3 Jan 13, 2021
@JedWatson
Copy link
Owner

Moving this to 3.3 so we can get the tests updated, 3.2 is about to be released

@ebonow
Copy link
Collaborator

ebonow commented Feb 2, 2021

Greetings @Malgalad ,

I have tested your changes and the proposed aria-relevant and aria-atomic changes suggested here introduces a new behavior in that a selected option is now prepended to every new aria live message.

Screen Shot 2021-02-01 at 4 43 59 PM

To replicate the previous behavior, I believe that that aria-atomic should be false. Someone please correct me if this is incorrect, but it seems to work as expected for me with this attribute set to false.

I am working on a new PR that moves all of the aira-live messaging to its own component with the hopes of better customizing the accessibility of this component. For instance, some may want to remove all aria live messaging while others may want to set the aria text to be "assertive" so that the user is not blocked by the default contextual information about "You are currently on a text input..."

I will likely pull in any changes that would be relevant, and welcome any feedback on #4414

@Methuselah96 Methuselah96 modified the milestones: 4.1, 4.2 Feb 5, 2021
@ebonow ebonow removed this from the 4.2 milestone Mar 4, 2021
@hprobotic
Copy link

Hi @Malgalad, I'm really grateful that you've put this work in on this! I had been trying to wrap custom-components with the necessary pieces to properly support aria and wcag, but no luck so far. Getting proper JAWS support is important to me.

I'd like to try out your PR in my project but am having trouble installing the module and getting it to run.

I've installed the module using yarn, and it appears in my dependencies as "@react-select/monorepo": "https://github.com/Malgalad/react-select.git",.
I'm trying to import the package using import Select, { components } from '@react-select/monorepo/packages/react-select';

But I'm guessing I've missed some sort of build-step. I didn't see, in the docs, how to go about doing that. Can you help point me in the right direction?

Hey have you managed to install?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/accessibility Issues or PRs related to accessibility pr/bug-fix PRs that are specifically addressing a bug pr/needs-review PRs that need to be reviewed to determine outcome pr/priority PRs that should be addressed sooner rather than later
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select accessiblity issues for JAWs and NVDA