-
Notifications
You must be signed in to change notification settings - Fork 192
Open
Description
Table of Contents
- Expected Behavior
- Current Behavior
- Possible Solution
- Steps to Reproduce (for bugs)
- Context
- Your Environment
Expected Behavior
If the date picker is open, the month should not change to the selected month when the component rerenders.
Current Behavior
The month resets when the component is rerendered while the date picker is open.
Possible Solution
Steps to Reproduce (for bugs)
- Select a date in November and close the date picker.
- Open the date picker and navigate to December.
- Date Picker rerenders due to some change in the props somewhere in the parent tree.
- The date picker now shows November again. I expect it to still be showing December since it has not been closed and a value has not been selected.
Context
We have data changes that cause a rerender at least once per second. This bug effectively means that you cannot select a date in another month.
As a temporary fix, I created a wrapper which uses componentShouldUpdate to only update the component when value changes. This is not ideal because it prevents the month from resetting to the selected value when the date picker is closed and opened again. It also prevents updates to other props, which is not a problem for my use case.
Your Environment
- Version used:
- Browser Name and version:
- Operating System and version (desktop or mobile):
- Link to your project:
jasonpastor
Metadata
Metadata
Assignees
Labels
No labels