Replies: 1 comment
-
Hi @tyforcode! Thanks for your feedback, I understand why this is unexpected. It could be enough to improve the documentation, as DayPicker in this case works as intended. To set the default month when rendering DayPicker use the https://react-day-picker.js.org/basics/navigation#change-the-default-month Example: https://codesandbox.io/p/sandbox/react-daypicker-forked-js8683?file=%2Fsrc%2FApp.tsx%3A1%2C1-24%2C1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Bug description
Thanks for the library! I found an issue where if you set the
selected
value of the<DayPicker>
component with something like an initial state, the component will not show the selected date in the UI. Instead, it will default to the earliest date in the range.To reproduce
https://codesandbox.io/p/sandbox/react-daypicker-forked-4n69dz
Steps
Date
stateDayPicker
componentExpected behavior
Ideally, the
DayPicker
component would show theselected
value by default when it's set by an outside state.Screenshots
n/a
Additional context
My specific use case is around a combination of
fromDate
,toDate
andcaptionLayout
where the year does not change correctly. However, this is also applicable to the baseDayPicker
component.Beta Was this translation helpful? Give feedback.
All reactions