Tooltips in Transfer sticks to the element when scrolling #205
-
I'm trying to use the tooltip.+.scrolling.movCan the tooltip be automatically hidden once the target element / initiator is moving on the screen? EDIT: I guess the main issue isn't the fact that the tooltip scrolls around (I'll let @cooper-joe be the judge of that), but at the very least the tooltip should'nt scroll outside of the |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 10 replies
-
For reference, the tooltip should disappear when the cursor is no longer hovering the trigger – via scrolling, moving the cursor etc. This behaviour is a bug. |
Beta Was this translation helpful? Give feedback.
-
This may not be an answer, but we had a similar issue in Dashboards. If the click happened on an element within the element having the mouseLeave event, then the event wasn't captured. Here is how it has been handled: https://github.com/dhis2/dashboard-app/blob/master/src/components/ControlBar/ShowMoreButton.js#L17 |
Beta Was this translation helpful? Give feedback.
-
Similar topics have come up recently. I think exposing a generic IntersectionObserver component might be helpful in providing a building block that could help resolve issues like this. We already have such an abstraction internally in ui. |
Beta Was this translation helpful? Give feedback.
-
Small update: according to Martin, this issue is currently considered "not a deal-breaker for 2.36, but a general problem that would be worth sorting out" - I'm still playing with it, especially to see if there's a way that the Tooltip component can be improved |
Beta Was this translation helpful? Give feedback.
-
Thanks to @HendrikThePendric's suggestion, the 'hide' modifier on poppers has proved to be the right tool for the job, and here's the result: tooltip-hide.movI'm interested in some feedback: (@dhis2/team-platform)
P.S. I made another solution work with Intersection Observers, but it was unnecessarily complex compared to this approach |
Beta Was this translation helpful? Give feedback.
-
Here's a new iteration with a 'flip' behavior that I think improves the behavior when the reference element is half-showing:
tooltip-hide-flip.mov |
Beta Was this translation helpful? Give feedback.
-
Fixed in UI v6.2.1 👍 |
Beta Was this translation helpful? Give feedback.
Fixed in UI v6.2.1 👍