-
Notifications
You must be signed in to change notification settings - Fork 211
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
fix(overlay): allow overlay to persist on hover #3706
Conversation
b9f5e6d
to
8ea6cd2
Compare
Tachometer resultsChromeaction-bar permalink
action-menu permalink
menu permalink
overlay permalink
picker permalink
popover permalink
split-button permalink
tooltip permalink
Firefoxaction-bar permalink
action-menu permalink
menu permalink
overlay permalink
picker permalink
popover permalink
split-button permalink
tooltip permalink
|
await nextFrame(); | ||
await nextFrame(); | ||
// allow "hover" content to close by waiting for its timer to complete | ||
await aTimeout(400); |
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 the tooltip should be “closed” at this point, could we leverage an sp-closed
listener instead?
3809f27
to
d46f854
Compare
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.
Let's double check that the tests you change continues to test what it did while adapting to this new feature. At least the comments seem out of date, but it's not clear that we're serving both the original and new intent appropriately.
@@ -53,6 +53,7 @@ import { PlacementController } from './PlacementController.js'; | |||
import styles from './overlay.css.js'; | |||
|
|||
const LONGPRESS_DURATION = 300; | |||
const HOVER_DELAY = 300; |
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.
how did you arrive at the 300ms duration? what likelihood is this going to be a tunable value?
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.
Great question! And great catch! I actually just picked an arbitrary number. I think I started with 400 and subconsciously changed it to 300 when I put this variable next to the longpress one 😅 I'll circle back on this and put some rationale behind this number and change it if needed!
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.
Nice work here! That removal of the old half logic might make this a new loss in end user JS, too 🚀
Description
A timer based approach to allowing hover content to persist so that a user can hover over it.
Related issue(s)
Motivation and context
Blocks Coachmark PR and Rich Tooltip PR. This also matches the expected behaviour for tooltips outlined by WACG.
How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.