Repository navigation
feat: add tooltip and aria-disabled state to CWV distribution histogram button - #1394
Open
max-ostapenko wants to merge 2 commits into
Open
max-ostapenko wants to merge 2 commits into
max-ostapenko wants to merge 2 commits into
Conversation
…am button Signed-off-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
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>
tunetheweb
requested changes
Nov 24, 2026
| return !tooltip.hidden; | ||
| } | ||
|
|
||
| positionTooltipFallback(btn, tooltip) { |
Member
There was a problem hiding this comment.
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); |
Member
There was a problem hiding this comment.
I don't understand what this does? The tooltip seems to be hidden immediately on tabbing out so why does it need a setTimeout?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Show histogram" button now uses
aria-disabled="true"instead of the nativedisabledattribute, allowing it to remain focusable and accessible. When disabled, it is linked to a tooltip viaaria-describedbyand a custominterestforattribute. The tooltip provides guidance on how to enable the histogram by selecting a specific metric.