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

[Bug]: MessageBar accessibility: Expose a way to control the assertiveness of the message #33227

Open
2 tasks done
tarun29061990 opened this issue Nov 7, 2024 · 1 comment

Comments

@tarun29061990
Copy link

Component

MessageBar

Package version

9

React version

17

Environment

System:
OS: Linux 6.5 Ubuntu 20.04.6 LTS (Focal Fossa)
CPU: (32) x64 AMD EPYC 7763 64-Core Processor
Memory: 114.10 GB / 125.78 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Browsers:
Chrome: 126.0.6478.182
npmPackages:
@types/react: ^17.0.39 => 17.0.39
@types/react-dom: ^17.0.11 => 17.0.25
react: ^18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0

Current Behavior

MessageBar component provides politeness as "assertive" and "polite". So, if there are multiple banners and we need disable the announcement of some banners then we cannot do so.

Expected Behavior

MessageBar component should provide politeness as "assertive", "polite" and "off".

Reproduction

https://stackblitz.com/edit/qy5pjm-erokou?file=src%2Fexample.tsx

Steps to reproduce

  1. Open screen reader
  2. Go to stackblitz link
  3. click on "toggle message bar display"
  4. Witness screen reader announcing the message text even when aria-live is "off" on the MessageBar component.

We tried setting the politeness to "off" but it only takes "assertive" | "polite" as value

Are you reporting an Accessibility issue?

yes

Suggested severity

High - No workaround

Products/sites affected

Microsoft teams

Are you willing to submit a PR to fix?

yes

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@smhigley
Copy link
Contributor

@tarun29061990 I've been thinking about this for a bit, and I'm partially wondering if another way to handle this might be to provide a way to override the message that is announced. In your case, you could potentially override the message for MessageBars you do not wish to be announced to an empty string, and providing that option would also allow other types of fine-grained announcement control.

Would you be able to provide an example of the real-world use case you're looking to solve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants