Description
Bug report
Current Behavior
At the moment component Hover Card
is working only based on the viewport and there are some edge cases where it stops working if we're trying to use it inside inner scrollable containers.
Demo 👀
Screen.Recording.2022-06-03.at.16.49.30.mov
I found a temporary solution, however it does not solve the issue itself:
- Add
portalled={false}
toHoverCard.Content
component. - Add
z-index: 0
toHoverCard.Content
component. - Add
background-color
as well asz-index: 1
to containers above and below.
Demo 👀
Screen.Recording.2022-06-03.at.16.50.05.mov
As you can see it solves the issue, but this approach leads to another bug. We're losing avoidCollisions
and collisionTolerance
features. The card itself is being hidden, however it does not avoid collisions anymore and being invisible, the result is bad UX.
Expected behavior
HoverCard
component should respect inner container boundaries and try to avoid collisions.
Suggested solution
I guess there are few solutions and I would be more than happy to contribute and fix it by myself, but I am not sure which solution is the best.
- Hide
HoverCard.Content
component on scroll. I am not sure about this one, because we should make sure that we're not scrolling for example insideHoverCard.Content
component. Also I am not sure if it should be working like that by default, maybe we should just simply add additional prop? - Add ability to pass the reference of parent container, in this case,
HoverCard.Content
component would respect container boundaries instead of viewport. I'm not sure if this solution can be easily implemented. - Your suggestions? 💡