UNPKG

downshift

Version:

🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.

16 lines (15 loc) 784 B
import * as React from 'react'; import { Environment } from '../../downshift.types'; /** * Tracks mouse and touch events, such as mouseDown, touchMove and touchEnd. * * @param environment The environment to add the event listeners to, for instance window. * @param handleBlur The function that is called if mouseDown or touchEnd occured outside the downshiftElements. * @param downshiftRefs The refs for the elements that should not trigger a blur action from mouseDown or touchEnd. * @returns The mouse and touch events information. */ export declare function useMouseAndTouchTracker(environment: Environment | undefined, handleBlur: () => void, downshiftRefs: React.RefObject<HTMLElement>[]): { isMouseDown: boolean; isTouchMove: boolean; isTouchEnd: boolean; };