File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99 z-index : 999 ;
1010 padding : variables .$xxs variables .$xs ;
11+ box-sizing : border-box ;
12+ // clamp to the space the popper has left on screen; the inner
13+ // auto scroll area shrinks with it and takes over scrolling
14+ max-height : var (--radix-popper-available-height , 100vh );
15+ display : flex ;
16+ flex-direction : column ;
1117
1218 & {
1319 @include box .box (variables .$tertiary );
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import React from "react";
22import { Color , ComponentProps , mergeComponentProps } from "../../utils" ;
33import * as RadixTooltip from "@radix-ui/react-tooltip" ;
44import "./Tooltip.style.scss"
5+ import { AutoScrollArea } from "../scroll-area/ScrollArea" ;
56
67export type TooltipProps = ComponentProps & RadixTooltip . TooltipProps
78export type TooltipTriggerProps = ComponentProps & RadixTooltip . TooltipTriggerProps
@@ -24,8 +25,13 @@ export const TooltipPortal: React.FC<TooltipPortalProps> = (props) => {
2425}
2526
2627export const TooltipContent : React . FC < TooltipContentProps > = ( props ) => {
28+ const { children, ...rest } = props
2729 return < RadixTooltip . TooltipContent
28- align = { props . align } { ...mergeComponentProps ( `tooltip__content tooltip__content--${ props . color ?? "tertiary" } ` , props ) as TooltipContentProps } />
30+ align = { props . align } { ...mergeComponentProps ( `tooltip__content tooltip__content--${ props . color ?? "tertiary" } ` , rest ) as TooltipContentProps } >
31+ < AutoScrollArea >
32+ { children }
33+ </ AutoScrollArea >
34+ </ RadixTooltip . TooltipContent >
2935}
3036
3137export const TooltipArrow : React . FC < TooltipArrowProps > = ( props ) => {
You can’t perform that action at this time.
0 commit comments