fix: clamp displayed month when endMonth changes - #3004
Conversation
|
rodgobbi
left a comment
There was a problem hiding this comment.
Hi @wanxiankai , thanks for the contribution! 🙏
But it's better to avoid useEffect, it's a common source of bugs with React.
Thanks to your PR I thought of a solution that doesn't rely on useEffect.
I'll prepare a PR to fix the issue and keep you posted. 👍
|
Do we actually need to change this? Can't the date be controlled upstream? 🤔 |
@gpbl but we would be forcing consumers to always control the month, and developer errors can still put the calendar in an unusable state. I'm following your idea here #2671 (comment) to always make sure the calendar is in a usable state. |
Summary
endMonthto a date smaller than the currently viewed month removes the month grid and dropdowns #2912.Fixes #2912
Tests