-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
report: make tools menu focus-able #9169
Conversation
@@ -366,12 +372,12 @@ | |||
<a href="" class="lh-topbar__url" target="_blank" rel="noopener"></a> | |||
|
|||
<div class="lh-tools"> | |||
<div class="report-icon report-icon--share lh-tools__button" title="Export report"> | |||
<button class="report-icon report-icon--share lh-tools__button" title="Export report"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this stays div
, would have to 1) use tabindex="0"
and 2) wire our own key event listener so space/enter would toggle the tools menu.
@@ -262,6 +262,14 @@ | |||
height: var(--lh-tools-icon-size); | |||
cursor: pointer; | |||
margin-right: 5px; | |||
/* Override default button styles. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add to the comment that this is an actual button
element but we want to style it like a transparent div
? :)
.lh-tools__button.active + .lh-tools__dropdown { | ||
opacity: 1; | ||
clip: rect(-1px, 187px, 242px, -3px); | ||
visibility: visible; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything extra this does for us compared to opacity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
visibility: none
removes elements from focus consideration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% fitting the accessbility rules of a dropdown but focus works 👌.
Well done! 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
...can you be more specific? :) |
Oh sorry :) It boils down to adding aria attributes and keyboard access. Tabbing isn't the correct way to handle it if you follow the spec. You should be using arrow keys instead. More info here: I don't think it's worth the effort in this PR 👍 |
Ah, ok. We should fix that, though :) |
Fixes #9168.