@awsui/components-react
Version:
On July 19th, 2022, we launched [Cloudscape Design System](https://cloudscape.design). Cloudscape is an evolution of AWS-UI. It consists of user interface guidelines, front-end components, design resources, and development tools for building intuitive, en
35 lines • 1.07 kB
TypeScript
import React from 'react';
import { InternalPosition, Offset, PopoverProps } from './interfaces';
export default function usePopoverPosition({
popoverRef,
bodyRef,
arrowRef,
getTrack,
contentRef,
allowScrollToFit,
allowVerticalOverflow,
preferredPosition,
renderWithPortal,
keepPosition,
hideOnOverscroll,
minVisibleBlockSize
}: {
popoverRef: React.RefObject<HTMLDivElement | null>;
bodyRef: React.RefObject<HTMLDivElement | null>;
arrowRef: React.RefObject<HTMLDivElement | null>;
getTrack: () => null | HTMLElement | SVGElement;
contentRef: React.RefObject<HTMLDivElement | null>;
allowScrollToFit?: boolean;
allowVerticalOverflow?: boolean;
preferredPosition: PopoverProps.Position;
renderWithPortal?: boolean;
keepPosition?: boolean;
hideOnOverscroll?: boolean;
minVisibleBlockSize?: number;
}): {
updatePositionHandler: (onContentResize?: any) => void;
popoverStyle: Partial<Offset>;
internalPosition: InternalPosition | null;
positionHandlerRef: React.MutableRefObject<() => void>;
isOverscrolling: boolean;
};