-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fine-tune delays in Tooltip
and associated components
#2368
base: main
Are you sure you want to change the base?
Conversation
…loating-delay-group
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.
I also notice the problem caused by delay when the label
prop is passed into IconButton
. Does it still need to be wrapped with FloatingDelayGroup
?
tooltip-delay-in-menu.mp4
Since those Also, noticed an issue in the example where the text parts of the |
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.
I also notice the problem caused by delay when the
label
prop is passed intoIconButton
. Does it still need to be wrapped withFloatingDelayGroup
?Since those
Tooltip
s are across different instances ofIconButton
s, this PR doesn't address that atm.
Could we use FloatingDelayGroup
in List
? It makes sense because it is an isolated component containing repeated items (similar to SideNavigation
/Stepper
/ButtonGroup
/etc).
Makes sense, wrapped However, added the Screen-recording
|
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.
But when going from bottom to top, there's not much improvement.
One fix for that would be to change the tooltip's placement
, which consumers can do on their own.
I think this is quite a common issue for lists, and we should probably recommend changing placement
in our documentation somewhere.
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
Sounds good, added the documentation part as an after-PR TODO since I saw your approval. |
Note
Merging this PR in the next minor release (#2368 (comment)).
Changes
After we fixed the default
Tooltip
delay in #2263, a couple of components had the problem of lingering tooltips. To fix it, this PR wraps some of the parts of the affected components within Floating UI'sFloatingDelayGroup
.Components where
FloatingDelayGroup
wrapper is added:SideNavigation
Slider
Stepper
List
(#2368 (review))While this PR fixes the lingering tooltip problem within the items of the component itself, it doesn't fix the problem between two components. To fix the latter part also, I had considered moving
FloatingDelayGroup
to theThemeProvider
but then didn't go that route based on our internal discussion. One of the reasons to not go that route was to prevent unintended issues.According to our discussion, I also changed the default tooltip delay from
{ open: 50, close: 250 }
to{ open: 100, close: 200 }
. If we later find research regarding the best delay values, we can further fine-tune this default delay.Testing
CI passing after small updates to the tests.
Before and After
Before.mov
After.mov
Before.mov
After.mov
Before.mov
After.mov
Docs
Added a changeset.
After PR TODOs:
placement
of theTooltip
(#2368 (review))