UNPKG

@cbinsights/fds

Version:
17 lines (16 loc) 782 B
import { RefObject } from 'react'; /** * Hook that disables scroll on a DOM node when `isDisabled` is true. * * @param {Object} disableScrollRef - react ref to DOM node * @param {Boolean} isDisabled */ export declare const useDisableScroll: (disableScrollRef: RefObject<HTMLElement> | undefined, isDisabled: boolean) => void; /** * Hook that invokes `closeCallback` if a popover is active when a user scrolls. * * @param {Object} closeOnScrollRef - react ref to scrolling DOM node * @param {Boolean} isActive - if the popover is currently open/active * @param {Boolean} closeCallback - function that closes the popover */ export declare const useCloseOnScroll: (closeOnScrollRef: RefObject<HTMLElement> | undefined, isActive: boolean, closeCallback: () => void) => void;