nrkno / core-components

Accessible and lightweight Javascript components
https://static.nrk.no/core-components/latest/
MIT License
117 stars 10 forks source link

Core suggest aria-live #644

Closed skjalgepalg closed 2 years ago

skjalgepalg commented 2 years ago

What's new

Updates to textContent on aria-live-region, when visible, is done using a delay of 150 ms, to allow VoiceOver to announce more important info about the input-element before being informed of suggestions.

Docs

Next steps

Open for input on how to fix the caveat where setting innerHTML on core-suggest-element is never sent to SRs. So far just moving the update to a child-element seems to work fine. React/Svelte/Vue/Angular authoring practices are not affected by this (usually map items inside <ul> anyway). -> No longer an issue with _ariaLiveSpan being moved to body.

This change requires manual testing of intended behaviour across various devices and screen-readers (SRs). In development testing/verification has been done using Google Chrome and Safari with VoiceOver.

We will also test whether the role="combobox" is necessary for iOS still, and if it may be helpful for other devices or SRs. As the implementation is not in line with the FAQ-section of the docs. -> So far, testing indicates we can once more use combobox for all instances, not just for iOS.

Resolves https://github.com/nrkno/core-components/issues/642

skjalgepalg commented 2 years ago

Testing done and findings added to the docs. Should be ready for review now!