[Bug]: AriaLiveAnnouncer holds back a message announced in the commit that mounts it
Los mantenedores suelen responder en 2 días
@dmytrokirpa ya está trabajando en esto.
Desde el 23/11/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- accessibility, frontend
Línea de trabajo
Empieza en useDomAnnounce.ts en el efecto que crea el elemento de live region y en el return temprano if (timeoutRef.current || !elementRef.current) dentro de queueMessage. Ejecuta las pruebas unitarias existentes de AriaLiveAnnouncer y luego añade un caso en el que un hijo anuncia en el mismo commit en que se monta el announcer. Terminado cuando ese mensaje se escribe una vez que el elemento existe en lugar de esperar al siguiente announce.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 20.4k
- Forks
- 3k
- Merge medio
- 3 d 15 h
- PR fusionados (30 d)
- 74
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/fluentui
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 2 días
-
[Bug]: Toaster throws in development when it has a style propPosiblemente ocupada @jakesalvesen la tomó hace 35 días. AbiertoComponent: Toast Fluent UI react-components (v9) Type: Bug :bug:
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
[Bug]: MessageBar announces the title and body without a space between themPosiblemente ocupada @jakesalvesen la tomó hace 2 días. AbiertoFluent UI react-components (v9) Type: Bug :bug:
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 2 días
-
[Bug]: fluent-radio-group ignores value changes while disabledPosiblemente ocupada @chrisdholt la tomó hace 1 día. AbiertoFluent UI WC (v3) web-components
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/fluentui#37198 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
[Bug]: Accordion crashes for scalar `defaultOpenItems={0}` (headless and styled v9)Posiblemente ocupada @arniebradfo la tomó hace 22 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/fluentui
Issues similares
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Posiblemente ocupada @goranai la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Inbox permission: an allow sent with `updatedInput` is ignored by Claude Code on its own safety checksPosiblemente ocupada @Raj1v la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
backnotprop/plannotator#4046 ·
Los mantenedores suelen responder en 1 día
-
進捗部屋の管理画面で削除対象を月ごとに絞り込むAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
traPtitech/knoQ_R-UI#290 ·
Los mantenedores suelen responder en 24 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
farion1231/cc-switch#9981 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
account bug course exam iris lecture
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día