Skip to content

Commit

Permalink
feat(popover): add container property
Browse files Browse the repository at this point in the history
closes #3795
  • Loading branch information
ZettZet committed Oct 31, 2024
1 parent fa45902 commit e9def58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export type PopoverProps = PropsWithJsxAttributes<
onClickOutside?: ClickOutsideHandler;
onSetDirection?: (direction: Direction) => void;
viewportRef?: React.RefObject<HTMLElement>;
container?: Element;
} & PositioningProps
>;

Expand Down Expand Up @@ -194,6 +195,7 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
equalAnchorWidth,
onSetDirection,
viewportRef,
container = window.document.body,
...otherProps
} = props;

Expand Down Expand Up @@ -308,7 +310,7 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
{...otherProps}
preset={theme}
className={cnPopover({ direction, notVisible }, [className])}
container={window.document.body}
container={container}
ref={useForkRef([ref, componentRef])}
style={{
...style,
Expand Down

0 comments on commit e9def58

Please sign in to comment.