Skip to content
Source
Sign inSign up
TanStack/query

Improve aria-tagging of Devtools #2901

Send to my agent
ClosedSvish(GitHub profile, opens in a new tab) opened this issue 7 comments

Describe the bug

  1. Devtools is now defaulting to being rendered as footer, which doesn't make a lot of sense to me.
  2. Menu-items for sorting seem to be rendered and visible in the Accessibility Tree regardless of open/closed state.
  3. 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:

  1. Render React-Query Devtools in an app
  2. Explore the DOM tree and the Accessibility tree

Expected behavior

  1. A better default should probably be aside, and it should also have an aria-label (like "React Query Devtools" for the landmark it generates.
  2. 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-hidden or something like that when not opened?
  3. Toggle-button should have appropriate aria attributes (aria-controls, aria-expanded and be linked to the panel as it should.

Screenshots In the screenshot below, the React Query Devtools "root" is the generic contentinfo node image 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: image

  1. TkDodo added labelshelp wanted

  2. TkDodo added labelspackage: react-query-devtools

  3. I agree, this could be improved. I like your suggestions. Would you like to contribute it?

  4. 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 😕

  5. oh interesting. we're also using npm at work, and I'm actually enjoying yarn in RQ because it's a lot faster. I've just done npm i -g yarn and it worked well until now 😅

  6. 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. 😛

  7. Hi @TkDodo, I want to help with this request.

    1. Seem straightforward.
    2. Can confirm that menuitem should not appear in the a11y tree. Will look into this.
    3. Seem straightforward. I'll follow the guidelines here https://www.w3.org/TR/wai-aria-practices/examples/menu-button/menu-button-links.html
  8. @Andrewnt219 that would be very much appreciated - thank you 🙏

  9. TkDodo closed this

  10. :tada: This issue has been resolved in version 3.33.1 :tada:

    The release is available on:

    Your semantic-release bot :package::rocket:

  11. tannerlinsley added labelsreleased

Sign in to join this conversation.