-
Notifications
You must be signed in to change notification settings - Fork 26
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
[Tooltip]: adds arrow on tooltip default mode #457
[Tooltip]: adds arrow on tooltip default mode #457
Conversation
@@ -31,17 +31,21 @@ | |||
let arrow: HTMLElement | |||
let trigger: HTMLElement | |||
|
|||
let arrowPlacement: string = undefined |
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.
This is used as a classname to style the arrow borders
const debouncedMouseleave = (event: MouseLeaveEvent) => { | ||
let debounce | ||
|
||
return () => { | ||
clearTimeout(debounce) | ||
|
||
debounce = setTimeout(() => { | ||
if (!contentHovered) { | ||
setVisible(false) | ||
} | ||
}, 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.
Gives the cursor some time to hover over the content in the tooltip, in case there is some action that can be done in the tooltip.
@@ -96,7 +96,7 @@ | |||
} | |||
</script> | |||
|
|||
<div bind:this={floating} class="leo-floating"> | |||
<div on:mouseenter on:mouseleave bind:this={floating} class="leo-floating"> |
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 want to expose these so I can control when the tooltip should close
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.
Yeah, I feel like we should do this more!
14e5d50
to
ed40285
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.
This looks great, thanks!
@@ -96,7 +96,7 @@ | |||
} | |||
</script> | |||
|
|||
<div bind:this={floating} class="leo-floating"> | |||
<div on:mouseenter on:mouseleave bind:this={floating} class="leo-floating"> |
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.
Yeah, I feel like we should do this more!
Oh, looks like the Also, noticed a little bug while testing. If you mouseover the trigger, to open a tooltip, mouse into the tooltip and then mouse into the trigger the tooltip will be closed. Screencast from 2023-10-30 10-35-21.webm |
7229afb
to
16788b6
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.
LGTM, pending fix of the hover issue
f29fec9
to
8501a8e
Compare
104724e
to
9b481ff
Compare
Latest should fix this issue: Screen.Recording.2023-10-29.at.11.44.47.PM.movScreen.Recording.2023-10-29.at.11.44.05.PM.mov |
6604c7c
to
5eb81c6
Compare
2873d63
to
eda5c2c
Compare
eda5c2c
to
1a1111a
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.
LGTM
Resolves #444
Right now tooltips on default mode don't show an arrow. This PR adds an arrow and solves an issue with the tooltip disappearing when trying to interact with the content (such as a button).
Screenshots
Before
Screen.Recording.2023-10-27.at.12.24.16.AM.mov
After
Screen.Recording.2023-10-26.at.11.52.31.PM.mov