Repository navigation
Hide the default avatar initials from screen readers in production builds - #5899
Open
Eugene (OEvgeny) wants to merge 2 commits into
Open
Eugene (OEvgeny) wants to merge 2 commits into
Eugene (OEvgeny) wants to merge 2 commits into
Conversation
added 2 commits
October 18, 2026 02:14
Since 4.19.0, DefaultAvatar relied on a valibot schema default for aria-hidden. validateProps() does not parse props in production builds, so the default was never applied and screen readers read the initials before every message. Default it in the component, as before 4.19.0.
Eugene (OEvgeny)
marked this pull request as ready for review
October 18, 2026 18:14
Eugene (OEvgeny)
requested review from
William Wong (compulim),
Chris Whitten (cwhitten) and
TJ Durnford (tdurnford)
as code owners
October 18, 2026 18:14
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog Entry
Fixed
Description
Since #5779,
DefaultAvatarrelies on the valibot schema to defaultaria-hiddentotrue.validateProps()does not parse props in production builds, so the default is never applied and screen readers read the initials before every message (the "BO Bot JO said:" in #5803). The default is now set in the component again, as before 4.19.0.Design
validateProps()), like other components, and the schema no longer declares a default that production builds never apply.validateProps(…, 'strict')apply schema defaults in production too?AbsoluteTime,RovingTabIndexComposer, and Fluent'sActivityLoaderalso declare schema defaults; they are never applied in any build, but their callers do not rely on them.Specific Changes
DefaultAvatar.tsx:aria-hiddendefaults totruein the component instead of the schema.DefaultAvatar.spec.tsx: new unit test that rendersDefaultAvatarwithvalidateProps()as in production builds; html2 tests run development builds.I have added tests and executed them locally
I have updated
CHANGELOG.mdI have updated documentation
Review Checklist
z-index)package.jsonandpackage-lock.jsonreviewed