Skip to content

Commit aeb0637

Browse files
authored
fix: tooltip container padding (#8625)
1 parent 2d9262c commit aeb0637

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/react-aria-components/src/Tooltip.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ function TooltipInner(props: TooltipProps & {isExiting: boolean, tooltipRef: Ref
142142
arrowSize: arrowWidth,
143143
arrowBoundaryOffset: props.arrowBoundaryOffset,
144144
shouldFlip: props.shouldFlip,
145+
containerPadding: props.containerPadding,
145146
onClose: () => state.close(true)
146147
});
147148

packages/react-aria-components/stories/Tooltip.stories.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,17 @@ export const TooltipArrowBoundaryOffsetExample: StoryObj<typeof TooltipArrowBoun
333333
},
334334
render: (args) => <TooltipArrowBoundaryOffsetExampleRender {...args} />
335335
};
336+
337+
export const TooltipContainerPaddingExample: StoryObj<typeof Tooltip> = {
338+
render: (args) => (
339+
<TooltipTrigger>
340+
<Button style={{position: 'absolute', top: 0, left: 0}}>Tooltip trigger</Button>
341+
<Tooltip {...args}>
342+
I am a tooltip
343+
</Tooltip>
344+
</TooltipTrigger>
345+
),
346+
args: {
347+
containerPadding: 10
348+
}
349+
};

0 commit comments

Comments
 (0)