Unable To Set Focus After Date Selection
Describe the bug For example, unable to focus the end date text input after start date has been selected.
To Reproduce Here's a MCVE
const endDateRef = useRef<DatePicker>(null);
<DatePicker
// ... rest props
selectsStart
onSelect={() => endDateRef.current?.setFocus()}
/>
<DatePicker
// ... rest props
selectsEnd
ref={endDateRef}
/>
Expected behavior
DatePicker should accept a prop to NOT reset focus back to the input.
Desktop (please complete the following information):
- OS: macOS Sonoma
- Browser: Chrome
- Version: 129.0.6668.59
Additional context Its happening because the start date text input is focused asynchronously after start date has been selected and end date text input has been focused.
https://github.com/Hacker0x01/react-datepicker/blob/9ad0ce00383f769371d670c530541321292e4698/src/index.tsx#L668-L672
https://github.com/Hacker0x01/react-datepicker/blob/9ad0ce00383f769371d670c530541321292e4698/src/index.tsx#L519-L534
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 10 days.
This issue was closed because it has been stalled for 10 days with no activity.