Skip to content

fix(web): make clickable tags, labels and column headers keyboard accessible - #42867

Open
Ashraf Ali (ashrafiucse) wants to merge 2 commits into
microsoft:mainfrom
ashrafiucse:fix-42559
Open

Ashraf Ali (ashrafiucse) wants to merge 2 commits into
microsoft:mainfrom
ashrafiucse:fix-42559

Conversation

@ashrafiucse

Copy link
Copy Markdown
Contributor

Summary

Fixes #42559

…essible

Label chips, tag chips and sortable grid column headers were divs/spans
with an onClick, so they could not be focused or activated from the
keyboard. Render a real button when the control has a click handler
(all: unset / inherit so nothing changes visually, plus a :focus-visible
outline), and keep the span when there is nothing to activate or when
the chip sits inside an anchor, which is already focusable.

Revives microsoft#42471 and microsoft#42472 against their issue, with keyboard tests for
the tag filter and the network column sorting.

Fixes: microsoft#42559
Mirrors the existing click-based label filter test with keyboard-only
activation (Enter and Space) for the label chips turned into buttons.

Fixes: microsoft#42559
@ashrafiucse

Copy link
Copy Markdown
Contributor Author

Spent some time walking the report with the keyboard only, and one thing is still out of reach: the project chips (the chromium label on each test row). They render inside Link's <a onClick> with no href, and an anchor without an href isn't tabbable, so those stay mouse-only. Everything named in the issue — tag chips, label chips, column headers — is reachable and activatable from the keyboard now (added a test for the label filter in the last commit too).

Giving Link a real href would fix the project chip, but that reshuffles the tab order across the whole report, so I kept it out of this PR. Happy to take it as a follow-up.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant