downshift
Version:
🏎 A set of primitives to build simple, flexible, WAI-ARIA compliant React autocomplete, combobox or select dropdown components.
8 lines (7 loc) • 360 B
TypeScript
/**
* Returns the new highlightedIndex based on the defaultHighlightedIndex prop, if it's not disabled.
*
* @param props Props passed to the hook.
* @returns The highlighted index.
*/
export declare function getDefaultHighlightedIndex<Item>(items: Item[], isItemDisabled: (item: Item, index: number) => boolean, defaultHighlightedIndex?: number): number;