diff --git a/src/community/components/tooltip/tooltip-provider.tsx b/src/community/components/tooltip/tooltip-provider.tsx index c93a1060..83346a08 100644 --- a/src/community/components/tooltip/tooltip-provider.tsx +++ b/src/community/components/tooltip/tooltip-provider.tsx @@ -164,7 +164,10 @@ export const TooltipProvider = (props: TooltipProviderProps): JSX.Element => { middleware: [ offset(offsetOptions), flip(), - shift({ padding: 8 }), + shift({ + altBoundary: true, + padding: 8, + }), arrow({ element: arrowRef, padding: 4, @@ -184,6 +187,7 @@ export const TooltipProvider = (props: TooltipProviderProps): JSX.Element => { }), useRole(context, { role }), useDismiss(context, { + ancestorScroll: true, outsidePressEvent: openWith === 'click' ? 'mousedown' : 'pointerdown', // https://floating-ui.com/docs/dialog#interaction-hooks }), ]); diff --git a/src/community/components/tooltip/tooltip.stories.tsx b/src/community/components/tooltip/tooltip.stories.tsx index 132dab8b..f399acec 100644 --- a/src/community/components/tooltip/tooltip.stories.tsx +++ b/src/community/components/tooltip/tooltip.stories.tsx @@ -253,3 +253,29 @@ export const TooltipPosition: StoryFn = () => { ); }; + +export const ScrollableRowInCard: StoryFn = () => { + return ( + + +
+
+ + + + Lorem ipsum dolor sit amet + + + Lorem ipsum dolor sit amet + +
+
+ +
+ ); +};