New tooltip layout #126
Replies: 4 comments 2 replies
-
This looks great. I will sum up my understanding to assure I got it correctly - the Tooltip and the Reference will always "touch" themselves (although both will be in different stacking context) the arrow will be |
Beta Was this translation helpful? Give feedback.
-
Looks like the new layout doesn't resolve the issue. Seems react-popper position the tooltip so there's always or at least sometimes an overlap. Maybe it's because of the fractional pixels or rounding errors. Here I set show/delay to 500ms to make the effect more noticeable. In some positions, the cursor alternately triggers Kapture.2021-03-13.at.13.16.03.mp4We can fix it by adding Updated: Huh, seems it's the only fix we need to apply in order to make everything work as expected. In non-interactive mode |
Beta Was this translation helpful? Give feedback.
-
Here's the PR #127 |
Beta Was this translation helpful? Give feedback.
-
I slept a night with this idea and now I'm not sure we should introduce any breaking changes, change the tooltip layout, and so on. Our hook is flexible enough so the user can implement this change by themselves if this is their case. The changes I wanted to introduce are actually don't require layout change. They can be implemented using |
Beta Was this translation helpful? Give feedback.
-
Hi guys, sorry I late for the party.
I noticed that the last changes in the code base replacing
mouseleave
event with the calculatedmouseOutside
brought more bugs and edge cases than expected.My idea is to revert changes back to mouseleave and eliminate the offset option.
Here's a rough sketch of how it might work.
We need to change our example's HTML-markup, add an additional container inside of the tooltip. The offset will be now set within the CSS. I suggest adding
pointer-events: none
to the arrow element by default in all cases, make it purely decorative. It shouldn't prevent user interactions with the tooltip.Such composition let us avoid the necessity of setting delayHide for the interactive tooltips because as soon as a user moved a cursor from the reference element in the direction of the tooltip - they're already hovering the tooltip even if the cursor is over the yellow zone.
I'll try to make a PR soon.
Let me know your thoughts @mohsinulhaq @czabaj
Beta Was this translation helpful? Give feedback.
All reactions