I'm encountering an issue with react-datepicker in a React project, specifically version 2.11.0. While the date picker functions correctly on desktop, I'm facing a problem with mobile view. When viewing the date picker on a mobile device, only the first month is visible and I'm unable to scroll horizontally to view additional months.
Here's the relevant code snippet:
<div>
<DatePicker
selected={selectedDate}
onChange={date => {dateChange(date)}}
inline
maxDate={extendedDate()}
minDate={new Date()}
nextMonthButtonLabel=""
previousMonthButtonLabel=""
monthsShown={2}
/>
</div>
I've tried adjusting the monthsShown prop, but it doesn't seem to resolve the issue on mobile devices.
Could someone please provide guidance on how to enable horizontal scrolling for react-datepicker in mobile view? Any suggestions or alternative approaches would be greatly appreciated. Thank you!