Improve aria-tagging of Devtools #2901
Send to my agentDescribe the bug
- Devtools is now defaulting to being rendered as
footer, which doesn't make a lot of sense to me. - Menu-items for sorting seem to be rendered and visible in the Accessibility Tree regardless of open/closed state.
- The Devtools toggle-button have no aria-attributes for toggled state or link to the panel it toggles.
To Reproduce Steps to reproduce the behavior:
- Render React-Query Devtools in an app
- Explore the DOM tree and the Accessibility tree
Expected behavior
- A better default should probably be
aside, and it should also have anaria-label(like "React Query Devtools" for the landmark it generates. - Not sure if this is an actual issue, or just how the accessibility tree works, but I'm thinking the panel should maybe either not be rendered at all, or be rendered with
aria-hiddenor something like that when not opened? - Toggle-button should have appropriate aria attributes (
aria-controls,aria-expandedand be linked to the panel as it should.
Screenshots
In the screenshot below, the React Query Devtools "root" is the generic contentinfo node
Changing the element-type to aside and adding an aria-label (just edited the HTML in Chrome for this) gives this instead, which to me at least looks more appropriate:

TkDodo added labelshelp wanted
TkDodo added labelspackage: react-query-devtools
If you weren't using yarn, I probably could, but trying to stay away from yarn as it tends to try taking over my computer and mess up non-yarn stuff as well. I've tried to just run the yarn stuff via npx, but usually ends up not building properly or something 😕
oh interesting. we're also using
npmat work, and I'm actually enjoying yarn in RQ because it's a lot faster. I've just donenpm i -g yarnand it worked well until now 😅yarn had some advantages in the beginning, but feel they're not that much different now. So I prefer to stick with what's most "industry standard". Especially after I experienced yarn being pushy. Or rather, people writing stuff with yarn being pushy. For example (a while ago now, so might have been fixed), when I tried to use create-react-app, it would generate a lot of yarn stuff, even though I had not mentioned yarn anywhere and ran it via npm. That, and other experiences, annoy me, so I've ended up trying to stay away from it and not have it on my computer. 😛
Hi @TkDodo, I want to help with this request.
- Seem straightforward.
- Can confirm that
menuitemshould not appear in the a11y tree. Will look into this. - Seem straightforward. I'll follow the guidelines here https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-links.html
@Andrewnt219 that would be very much appreciated - thank you 🙏
TkDodo closed this
:tada: This issue has been resolved in version 3.33.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
tannerlinsley added labelsreleased
Sign in to join this conversation.
I agree, this could be improved. I like your suggestions. Would you like to contribute it?