@acrool/react-picker
Version:
This is a react method to quickly combine buttons with Picker
16 lines (15 loc) • 786 B
TypeScript
import { RefObject } from 'react';
import { EVertical, IPosition } from '../types';
/**
* Get the closest scrollable parent of an element.
* Caches results for performance.
*/
export declare function getScrollParent(element: HTMLElement): HTMLElement | Window;
/**
* Update the position of the picker element relative to the anchor element.
* @param anchorRef Reference to the anchor element.
* @param pickerRef Reference to the picker element.
* @param importantPosition 強制指定位置
* @param setVertical 設定垂直(top/bottom, 讓選擇棄可以決定順序
*/
export declare const updatePosition: (anchorRef: RefObject<HTMLElement | null>, pickerRef: RefObject<HTMLElement | null>, setVertical: (vertical: EVertical) => void, importantPosition?: IPosition) => void;