The picker uses the findNearestEnabledIndex function to skip disabled options:
// From source: packages/react-wheel-picker/src/index.tsx:38-89const findNearestEnabledIndex = <T extends WheelPickerValue>( startIndex: number, direction: 1 | -1, options: WheelPickerOption<T>[], infinite: boolean): number => { if (options.length === 0) return startIndex; // Check if all items are disabled const hasEnabledItem = options.some((opt) => !opt.disabled); if (!hasEnabledItem) return startIndex; const searchInDirection = (dir: 1 | -1): number => { let currentIndex = startIndex; let attempts = 0; const maxAttempts = options.length; while (attempts < maxAttempts) { currentIndex = currentIndex + dir; if (infinite) { // Wrap around for infinite mode currentIndex = ((currentIndex % options.length) + options.length) % options.length; } else { // Clamp for non-infinite mode if (currentIndex < 0 || currentIndex >= options.length) { return -1; // No enabled item found in this direction } } if (!options[currentIndex]?.disabled) { return currentIndex; } attempts++; } return -1; }; // First, search in the given direction let nearestIndex = searchInDirection(direction); // If not found, reverse and search the other direction if (nearestIndex === -1) { nearestIndex = searchInDirection((direction * -1) as 1 | -1); } // If still not found, return the start index return nearestIndex === -1 ? startIndex : nearestIndex;};
The function:
Searches in the scroll direction for the nearest enabled option
If none found, searches in the opposite direction
Handles both infinite and non-infinite modes
Wraps around in infinite mode
The search direction is based on the scroll direction - scrolling down searches downward first, scrolling up searches upward first.
Clicking on a disabled option does nothing - the picker won’t scroll to it:
// From source: packages/react-wheel-picker/src/index.tsx:467-473// Do nothing if clicking on a disabled itemif (options[normalizedIndex]?.disabled) { return;}scrollByStep(stepsToScroll);
If you programmatically set value to a disabled option’s value, the picker will automatically find and select the nearest enabled option.