Replies: 1 comment 3 replies
-
@rodgobbi, thanks for the thorough review of the dropdown! I understand its limitations when displaying multiple months... The dropdown was not intended for use when displaying multiple months. In my opinion, multiple dropdowns do not provide a good user experience. If developers require a dropdown to change the calendar view, they should create their own control instead, external to DayPicker.
In conclusion, I believe it’s not worth fixing the bugs with the dropdown menu and multiple months. Related to the
These are valid points. I believe it would be a good enhancement to remove the |
Beta Was this translation helpful? Give feedback.
-
@gpbl
When working on #2614, I tested different use cases and noticed some behaviors that I think can be improved based on what an end-user would expect.
I'll list below what I found and write ideas on how it could be improved, IMO.
We can then discuss more ideas, and if it makes sense to change any of the things mentioned below, I'll open PRs to implement the changes.
1 - If there's a dropdown only for the month (
captionLayout="dropdown-months"
), thestartMonth
andendMonth
are set to default values.This behavior makes sense when the day picker has the select dropdown for the year, but causes an unexpected limitation when there's only the select dropdown for the month, especially for the
endMonth
default value which is the end of the current year.IMO, it makes sense to allow the users to navigate to any year by default using the calendar arrows.
This means the day picker doesn't set any default value to
startMonth
andendMonth
, and only uses the values explicitly passed as prop, setting the limit for the calendar month navigation based only on the props with a value.2 - When there are multiple months in the calendar, clicking on a select dropdown around the calendar always changes the first calendar month.
Screen recording to visualize the behavior.
For me, it makes more sense to update the calendar month being changed with the dropdown and update the rest of the displayed months based on the change.
E.g.: if the user changes the third displayed month from July to November, the third displayed month changes to November (instead of the first displayed month like the current behavior, and the rest of the displayed months update based on this state change.
3 - When there are multiple months in the calendar, selecting a month near the
endMonth
hides the remaining displayed months if those months are afterendMonth
, causing the number of displayed months to not match thenumberOfMonths
prop value.Screen recording to visualize the behavior.
This edge case can happen when selecting a month with the select dropdowns, but also with other use cases like when
pagedNavigation
is equal totrue
.Does it make sense to handle this edge case in a different way?
The day picker could try to prevent the final number of displayed months from being smaller than the
numberOfMonths
prop value.Beta Was this translation helpful? Give feedback.
All reactions