LiveAnnouncer's announce is not working on the first trigger for NVDA and JAWS
- Dominant language
- TypeScript
- Stars
- 15.9k
- Forks
- 1.6k
- Avg merge
- 3d 9m
- Merged PRs (30d)
- 59
Description
### Provide a general summary of the issue here
When using the announce method of [LiveAnnouncer](https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/live-announcer/src/LiveAnnouncer.tsx) in @react-aria for the very first time, the message is not being announced as expected. However, subsequent triggers seem to work as expected. This issue is specific to NVDA and JAWS; it functions correctly with VoiceOver.
### 🤔 Expected Behavior?
The announce method should work consistently across all triggers, starting from the first one.
### 😯 Current Behavior
The message is not announced during the first trigger of the announce method, but it works on subsequent triggers.
### 💁 Possible Solution
- There's a potential race condition between the Assistive Technology and the creation of the live area.
- A suggested solution is to create the live region during the load time of the LiveAnnouncer module instead of waiting until the first invocation of announce.
### 🔦 Context
_No response_
### 🖥️ Steps to Reproduce
Please check the sandbox https://codesandbox.io/s/silly-hill-99v7q7?file=/src/App.js
### Version
3.25.1
### What browsers are you seeing the problem on?
Microsoft Edge
### If other, please specify.
_No response_
### What operating system are you using?
Windows
### 🧢 Your Company/Team
Adobe/Alert One
### 🕷 Tracking Issue
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.