Skip to content

feat: add tooltip and aria-disabled state to CWV distribution histogram button - #1394

Open
max-ostapenko wants to merge 2 commits into
mainfrom
abundant-bandicoot
Open

max-ostapenko wants to merge 2 commits into
mainfrom
abundant-bandicoot

Conversation

@max-ostapenko

@max-ostapenko max-ostapenko commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

The "Show histogram" button now uses aria-disabled="true" instead of the native disabled attribute, allowing it to remain focusable and accessible. When disabled, it is linked to a tooltip via aria-describedby and a custom interestfor attribute. The tooltip provides guidance on how to enable the histogram by selecting a specific metric.

…am button

Signed-off-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit d5c126b):

https://httparchive--pr1394-abundant-bandicoot-lrj3l2u4.web.app

(expires Mon, 30 Nov 2026 21:54:18 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1069cba7974889c25bacf4f0a19ddb6735592729

…le styles

Signed-off-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
return !tooltip.hidden;
}

positionTooltipFallback(btn, tooltip) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of fallback code here, yet it doesn't seem to work well:

  • Safari, doesn't work at all
  • Firefox, shows tooltip in bottom left hand corner, far away from the button and it's easily missed (I originally missed it).

Comment on lines +156 to +163
scheduleHideTooltip() {
if (this.tooltipHideTimer) {
clearTimeout(this.tooltipHideTimer);
}
this.tooltipHideTimer = setTimeout(() => {
this.tooltipHideTimer = null;
this.hideTooltip();
}, 150);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what this does? The tooltip seems to be hidden immediately on tabbing out so why does it need a setTimeout?

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.

2 participants