-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Steps to Reproduce
- Window's NVDA screen reader on.
- Run flutter web with example snackbar app. https://docs.flutter.dev/cookbook/design/snackbars#interactive-example
- Click button to show snackbar.
Expected results: Snackbar content should be read
Actual results: It is not read.
I did some investigation, per MDN
Simply including an aria-live attribute or a specialized live region role (such as role="alert") in the initial markup as it's loaded will have no effect.
Dynamically adding an element with an aria-live attribute or specialized role to the document also won't result in any announcement by assistive technologies (as, at that point, the browser/assistive technologies are not aware of the live region yet, so cannot monitor it for changes).
Always make sure that the live region is present in the document first, and only then dynamically add/change any content.
So we should first have an empty aria-live within dom and then change the content. However I don't see any workaround for this.
Semantic(liveregion:true, child: Text('')) won't create a live region since the content is empty. I couldn't add a meaningful live-region element either, because other platform: native Android works fine.
Any suggestions?