Handling accessibility in Combobox's requests status (loading, error) #8996
-
|
I'm creating a SearchBar using the Combobox component and I had questions about how to deal with the status of requests. My initial idea was:
I would like some help to know if this treatment of request states is in agreement from an accessibility point of view and how I could do this, as I had two problems:
Any help would be appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
I'm not sure what the retry button is, if it's an interactive child of the empty popover, that's not allowed. The only thing in the popover can be the listbox so that virtual focus management works. Otherwise you cannot keyboard navigate to the retry button. Does https://react-spectrum.adobe.com/react-aria/ComboBox.html#asynchronous-loading meet your needs? What version of our libraries are you on? it looks like we had a recent fix for something related #8708 |
Beta Was this translation helpful? Give feedback.
This announces both of them for me https://codesandbox.io/p/devbox/rac-combobox-requests-status-forked-58xc3q?file=%2Fsrc%2Fcomponents%2FSearchBarList.tsx%3A26%2C28
But only when I have VO hints turned off, those seem to take some level of precedence over the live announcements sometimes, but not always.
Btw, you don't need both live=polite and role=alert, a role=alert is already live=assertive, see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/alert_role
If things still aren't announcing, try again to render whatever the live region is, THEN, after some delay, add the message (like I do in the codesandbox). If you need to show the message within a shorte…