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 live message always displayed #3924

Open
okomarov opened this issue Feb 7, 2023 · 14 comments
Open

Aria live message always displayed #3924

okomarov opened this issue Feb 7, 2023 · 14 comments
Labels

Comments

@okomarov
Copy link

okomarov commented Feb 7, 2023

Describe the bug
After the commit for the Aria Live message 3070e4a I now get Selected date: Thursday, February 2nd, 2023 above my datepicker.

To Reproduce
Pick a date from a standard datepicker

Expected behavior
The aria live message should not show up on top of the datepicker

Screenshots

aria

Desktop (please complete the following information):

  • OS: Mac OS latest
  • Browser chrome
  • Version latest
@okomarov
Copy link
Author

okomarov commented Feb 7, 2023

As Svish points out in #3924 (comment), the issue happens when customising the CSS of the date-picker. Specifically, the aria message will be visible if you're overriding the whole styling for the .react-datepicker and miss to include or reuse the rule:

.react-datepicker__aria-live {

So the fix is to add that rule in your custom CSS or to explicitly use in the custom datepicker.


Outdated:

The workaround is to add the css rule:

.react-datepicker__aria-live {
  display: none;
}

@okomarov okomarov closed this as completed Feb 7, 2023
@okomarov okomarov reopened this Feb 7, 2023
@vertic4l
Copy link

vertic4l commented Feb 9, 2023

@martijnrusschen Please fix this. Latest version is not usable this way. And a css workaround shouldn't be the solution for it.

@Leningram
Copy link

Leningram commented Feb 15, 2023

Is there any plans to fix it? Why have it appeared? It also ruins tests for this component

@Svish
Copy link
Contributor

Svish commented Feb 15, 2023

Suddenly noticed this aria message here too now. Our CSS for the date-picker is fully custom, so we don't use any of the styles coming with the package. I'm guessing this is the case for others who see this text appearing too?

I think the actual fix for us with custom CSS would then be to copy the appropriate styles for this new aria element:

.react-datepicker__aria-live {
  position: absolute;
  clip-path: circle(0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  width: 1px;
  white-space: nowrap;
}

Removing it with display: none is not good, as that will also remove the element for screen-readers, which I'm guessing was the whole point of adding this aria-live element to begin with?

@ondrejsova
Copy link

same problem. somehow the latest version of css is not in the built package.

@VeekeeFr
Copy link

VeekeeFr commented Apr 9, 2023

I'ld also like to point out that the displayed text is forced as english, which may not be the current language used in the website.

Not beeing able to set the language is unusable for an ARIA text (well, this means that we have to use our own aria + translation system, and that this feature is quite useless to begin with).

@wallace-sf
Copy link

+1

@trainoasis
Copy link

trainoasis commented Apr 11, 2023

Is this related to this?
The issue seem to have been introduced in 4.10.0 as per above. We reverted back to 4.9.0 where the problem is not yet introduced for the time being.

@VeekeeFr
Copy link

VeekeeFr commented Apr 11, 2023

Yes it is. Switching to an optional ariaLiveRegion would be the wisest choice (imho).

@MikulasLebowski
Copy link

We have different experience, we had this exact issue in 4.8.0 already, we tried updating to 4.11.0 which did not help...

@Svish
Copy link
Contributor

Svish commented May 4, 2023

Switching to an optional ariaLiveRegion would be the wisest choice

Making an important accessibility feature optional, is not a good thing. The solution to this issue should be fairly simple, just update your custom CSS to hide the aria region as I described her: #3924 (comment). If you're not using custom CSS, then it's probably related to a different issue than this...

@h-evers
Copy link

h-evers commented Aug 16, 2023

It should at least be possible to configure the text not to be printed out - that's what configurations are for. An only CSS solution is not suitable for every situation. Using "areaLiveRegion" would be an ugly hack.

@trozzelle
Copy link

Per the comment above, changing .react-datepicker__aria-live to position: absolute; fixes the layout issue and retains the accessibility attribute.

Copy link

github-actions bot commented Jun 4, 2024

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests