Skip to content

HTML report and trace viewer: clickable elements aren't keyboard accessible #42559

Description

Several clickable controls in the report UI are plain divs and spans with an onClick, so they can't be focused or activated from the keyboard, and screen readers don't announce them as controls.

Three I ran into:

  • packages/html-reporter/src/labels.tsx, the label chips
  • packages/trace-viewer/src/ui/tag.tsx, the tag chips
  • packages/web/src/components/gridView.tsx, sortable column headers

So sorting a results table or filtering by a label is mouse only.

What I'd do is use a real <button> wherever there's an onClick, with all: unset so nothing changes visually, plus a :focus-visible outline. The label chips are the awkward one, since some of them render inside an anchor, so those would only become a button when there's an onClick and no href.

I had PRs up for these before I'd read the contributing guide properly (#42471 and #42472, both closed). Happy to redo them if you want this fixed, or to drop it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions