[Bug]: AriaLiveAnnouncer holds back a message announced in the commit that mounts it
メンテナーはふだん 2 日以内に返信
@dmytrokirpa がすでに取り組んでいます。
2026年11月23日 から。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 85/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
useDomAnnounce.ts の、live region 要素を作成する effect と、queueMessage 内の早期 return if (timeoutRef.current || !elementRef.current) から始めてください。既存の AriaLiveAnnouncer の unit test を実行し、次に、announcer をマウントするのと同じ commit で子が announce するケースを追加してください。そのメッセージが、次の announce を待つのではなく、要素が存在した時点で書き込まれれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Component
Utilities
Package version
9.75.2
React version
19.3.1
Environment
System:
OS: Windows 11 10.0.26200
CPU: 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
Memory: 15.7 GB
Binaries:
Node: 26.13.1
npm: 12.2.3
npmPackages:
@fluentui/react-components: 9.75.2 => 9.75.2
@fluentui/react-aria: 9.17.16 => 9.17.16
react: 19.3.1 => 19.3.1
react-dom: 19.3.1 => 19.3.1
Current Behavior
A message that is announced in the same commit that mounts AriaLiveAnnouncer is not written to the live region. It stays in the queue and is written later, together with the next message, whenever that one comes.
<AriaLiveAnnouncer>
<MessageBar>
<MessageBarBody>First message</MessageBarBody>
</MessageBar>
</AriaLiveAnnouncer>
Nothing is announced when this renders. When a second MessageBar with Second message is added later, the live region gets First message. Second message. . So the first message is announced at the wrong time, joined to an unrelated one, or never if nothing else is announced.
MessageBar announces on mount, so a MessageBar that is part of the first render of an app is the common case. A component that calls useAnnounce().announce() in a mount effect behaves the same way.
The cause, in useDomAnnounce.ts on master:
- The live region element is created in an effect. The effects of children run before the effects of their parent, so the child calls
announcebefore the element exists. announceputs the message in the queue and callsqueueMessage, which returns early atif (timeoutRef.current || !elementRef.current).- Nothing calls
queueMessageagain when the element is created, so the queue waits for the nextannounce.
This affects the live region path, which is used when document.ariaNotify is not available. That API is recent, so most of the browser versions in the Browser Support Matrix (apps/public-docsite-v9/src/Concepts/BrowserSupportMatrix.mdx: Edge and Chrome from 84, Firefox from 75, Safari from 14.1) use this path. The ariaNotify path passes each message on directly.
Output of the script in the reproduction link:
CASE 1 the first MessageBar renders together with AriaLiveAnnouncer
first render, with "First message": nothing written to the live region
1.5 s later, "Second message" is added: "First message. Second message. "
CASE 2 AriaLiveAnnouncer renders first
first render, no MessageBar: nothing written to the live region
1.5 s later, "First message" is added: "First message. "
1.5 s later, "Second message" is added: "Second message. "
I see the same in a browser, with a Cypress component test on master (4f812d44, Electron 130, which has no document.ariaNotify), with and without strict mode.
Expected Behavior
A message that was queued before the live region element existed is written once the element is created, as it is when AriaLiveAnnouncer was mounted earlier.
Starting the queue from the effect that creates the element does that:
elementRef.current = element;
if (messageQueue.peek()) {
queueMessage();
}
With that change the first message is written on its own in the cases above, and the AriaLiveAnnouncer unit tests still pass.
Reproduction
https://gist.github.com/jakesalvesen/b8be4546f95536f583f5c812c29729bf
Steps to reproduce
- In an empty directory run
npm i @fluentui/[email protected] react@19 react-dom@19 jsdom. - Save
repro.cjsfrom the gist and runnode repro.cjs. App.jsxshows the first case in a browser. It needs a browser withoutdocument.ariaNotify.
The script renders AriaLiveAnnouncer and prints what is written to its live region after each render. jsdom does not implement innerText, which the announcer uses to write the message, so the script maps innerText to textContent.
Are you reporting an Accessibility issue?
yes
Suggested severity
Low - Has or doesn't need a workaround
Products/sites affected
No response
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.
- 主要言語
- TypeScript
- スター
- 20.4k
- フォーク
- 3k
- 平均マージ
- 3日 15時間
- マージ済み PR(30日)
- 74
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/fluentui のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
[Bug]: Toaster throws in development when it has a style prop対応中かも @jakesalvesen が 35 日前に担当しました。 オープンComponent: Toast Fluent UI react-components (v9) Type: Bug :bug:
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
[Bug]: MessageBar announces the title and body without a space between them対応中かも @jakesalvesen が 2 日前に担当しました。 オープンFluent UI react-components (v9) Type: Bug :bug:
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 2 日以内に返信
-
[Bug]: fluent-radio-group ignores value changes while disabled対応中かも @chrisdholt が 1 日前に担当しました。 オープンFluent UI WC (v3) web-components
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/fluentui#37198 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
[Bug]: Accordion crashes for scalar `defaultOpenItems={0}` (headless and styled v9)対応中かも @arniebradfo が 22 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
microsoft/fluentui の issue をすべて見る
似ている issue
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10対応中かも @goranai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Inbox permission: an allow sent with `updatedInput` is ignored by Claude Code on its own safety checks対応中かも @Raj1v が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
backnotprop/plannotator#4046 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
traPtitech/knoQ_R-UI#290 ·
メンテナーはふだん 24 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
farion1231/cc-switch#9981 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
account bug course exam iris lecture
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信