hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.57k stars 658 forks source link

Shows random date on scroll Enabled #542

Open rohit-k-singh opened 2 years ago

rohit-k-singh commented 2 years ago

The Component show random date even thought the shownDate prop is passed as today's date

the shownDate is passed as prop with the value of today's date( new Date() ) and even the month and year selectors are showing proper date but the date below shows different year.

The props I am passing with the component.

<Calendar scroll={{enabled:true}} minDate={new Date()} onChange={(date) => console.log(date)} shownDate={new Date()} /> if minDate is passed then the date value shown is of year 2025 or sometimes 2041 and user cannot go beyond year 2025 or 2041. if minDate prop isn't passed then it is year 1925.

[BUG] Expected behaviour

Default date shown should be of today

Environment

Package Version: v1.4.0 React version: v17.0.2 Node version: v14.16.0 Browser: Chrome v96.0.4664.110

rohit-k-singh commented 2 years ago

[Bug] Update

If you pass the scroll property in the component then the above issue is occurring. scroll={{enabled:true}}

kwanso-ahsaanShuja commented 2 years ago

[Bug] Update If you pass the scroll property in the component then the above issue is occurring. scroll={{enabled:true}}

any solution for this if I want scroll in calendar?