Major Changes
-
2833337
#186 Thanks @clauderic! - SimplifyuseAnnouncement
hook to only return a singleannouncement
rather thanentries
. Similarly, theLiveRegion
component now only accepts a singleannouncement
rather than `entries.- The current strategy used in the useAnnouncement hook is needlessly complex. It's not actually necessary to render multiple announcements at once within the LiveRegion component. It's sufficient to render a single announcement at a time. It's also un-necessary to clean up the announcements after they have been announced, especially now that the role="status" attribute has been added to LiveRegion, keeping the last announcement rendered means users can refer to the last status.
Patch Changes
c24bdb3
#184 Thanks @clauderic! - Tweaked LiveRegion component:- Entries are now rendered without wrapper
span
elements. Having wrapperspan
elements causes VoiceOver on macOS to try to move the VoiceOver cursor to the live region, which interferes with scrolling. This issue is not exhibited when rendering announcement entries as plain text without wrapper spans. - Added the
role="status"
attribute to the LiveRegion wrapper element. - Added the
white-space: no-wrap;
property to ensure that text does not wrap.
- Entries are now rendered without wrapper