Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upQueue messages sent to LiveAnnouncer #17852
Comments
This comment has been minimized.
This comment has been minimized.
In general I think this could be a good improvement. It would be great to see a specific proposal/design doc for updating the existing |
This comment has been minimized.
This comment has been minimized.
How current LiveAnnouncer worksIn constructor LiveAnnouncer creates an If What QueuedLiveAnnouncer would changeThere will be a In constructor QueuedLiveAnnouncer creates only the If Potential breakagesI see two potential problems:
|
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
I like the idea of using |
Feature Description
LiveAnnouncer should be able to queue multiple messages and announce them one by one instead of announcing only the lates message.
Use Case
See https://stackblitz.com/edit/angular-b4jomd, it has a button which announces two messages "Table Foo was updated" and "Table Bar was updated" on click. It illustrates two use cases:
Simultaneous announcements. Current implementation of LiveAnnouncer uses a single DOM element for the announcement, so second message overrides the first one and screen reader users hear only the second message.
Consequent announcement of the same message. Current implementation will announce only distinct messages, i.e. clicking the button multiple times will produce only one message for the screen reader. That's not always convenient. For example, if you have a table on the page and you do some polling which updates the table 5 times, we need to be able to announce every of those updates so that screen reader users know what's happening on the page.
Implementation
We already have an implementation of a queued LiveAnnouncer which was used in GCP for the last 5 months, it alowed to fix a lot of accessibility problems on pages with heavy UIs. I will convert it to a PR here, but I'd like to have some discussion first. At the very least I'd like to know whether it should replace the existing LiveAnnouncer implementation or we should allow users to switch between two implementations