@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
16 lines (15 loc) • 778 B
TypeScript
import React from 'react';
type UseScrollDetectionWithAutoFocusParamsType = {
parentElementRef?: React.RefObject<HTMLElement>;
};
type UseScrollDetectionWithAutoFocusReturnType = {
handleScrollDetection: (element: HTMLElement | null | undefined) => void;
hasScroll: boolean;
};
/**
* Custom hook that determines if an element has scroll. Besides it will focus on the element if it has scroll and the active element is not inside the parent element.
*
* @returns An object containing the `hasScroll` boolean and the `handleScrollDetection` callback function to initialize the hook.
*/
export declare const useScrollDetectionWithAutoFocus: ({ parentElementRef, }: UseScrollDetectionWithAutoFocusParamsType) => UseScrollDetectionWithAutoFocusReturnType;
export {};