Skip to content

[Feature]: Ability to override or disable announce message in MessageBar component #36291

@ultrababs

Description

@ultrababs

Area

React Components (@fluentui/react-components)

Describe the feature that you would like added

Currently the message bar component does not allow aria-live to be off. While it does accept a politeness prop, it only allows polite or assertive. I am using the message bar component to display information that needs to be called out on the page; however, the current implementation is causing it to announce at top level. This caused issues during the external a11y usability study as it clogged up the screenreader announcements. It was suggested we allow the content to be read inline.

So basically, I would like to use the message bar as an actual message bar and not an alert. Looking through the Fluent useMessageBar.js runtime code, it calls announce regardless:

announce(message, {
            polite: computedPoliteness === 'polite',
            alert: computedPoliteness === 'assertive'
        });

Right now, the only way to solve this would be to completely recreate the message bar component. One of the suggestions from the teams channel thread was to add a prop that allowed overriding the announce string. I am also open to just allowing off as an accepted value to the aria-live prop.

Additional context

No response

Have you discussed this feature with our team

No response

Validations

  • Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.

Priority

High

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions