Skip to content

Hide the default avatar initials from screen readers in production builds - #5899

Open
Eugene (OEvgeny) wants to merge 2 commits into
mainfrom
OEvgeny/fix-avatar-initials-hidden-in-production
Open

Eugene (OEvgeny) wants to merge 2 commits into
mainfrom
OEvgeny/fix-avatar-initials-hidden-in-production

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Related to #5803

Changelog Entry

Fixed

  • Fixed screen readers reading the avatar initials, such as "JO", before every message in production builds since 4.19.0: the default avatar is hidden from assistive technologies again, related to #5803, in PR #5899, by @OEvgeny

Description

Since #5779, DefaultAvatar relies on the valibot schema to default aria-hidden to true. 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

  • Defaults stay in the component (destructuring after validateProps()), like other components, and the schema no longer declares a default that production builds never apply.
  • Open question: should validateProps(…, 'strict') apply schema defaults in production too? AbsoluteTime, RovingTabIndexComposer, and Fluent's ActivityLoader also declare schema defaults; they are never applied in any build, but their callers do not rely on them.

Specific Changes

  • DefaultAvatar.tsx: aria-hidden defaults to true in the component instead of the schema.

  • DefaultAvatar.spec.tsx: new unit test that renders DefaultAvatar with validateProps() as in production builds; html2 tests run development builds.

  • I have added tests and executed them locally

  • I have updated CHANGELOG.md

  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Eugene Olonov 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.
@OEvgeny
Eugene (OEvgeny) marked this pull request as ready for review October 18, 2026 18:14
Copilot AI balanced review requested due to automatic review settings October 18, 2026 18:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants