react-date-picker icon indicating copy to clipboard operation
react-date-picker copied to clipboard

Calendar not displaying screen containing minDate when passing dynamic value

Open MarinaGhe opened this issue 2 years ago • 2 comments

Before you start - checklist

  • [X] I followed instructions in documentation written for my React-Date-Picker version
  • [X] I have checked if this bug is not already reported

Unexpected behaviour when passing minDate and maxDate through props. I'm passing minDate value through props inside my DatePicker component and I have some weird scenarios.

Expected behavior

The react date picker element/wrapper should always be clickable in order to open the calendar. The calendar screen shown after minDate is updated should be the one containing the minDate value or date value.

Actual behavior

  1. If I have already selected a value in the DatePicker and the minDate props updates with another value, the calendar only opens when clicking on the icon or inside the input. The rest of the react date picker/wrapper element it's not clickable anymore.

  2. If I have already selected a value in the DatePicker and the minDate props updates with another value greater than the date value, the input is updated with the minDate value and the click problem persists.

  3. If I have already selected a value in the DatePicker and I open the calendar screen after minDate is updated, the dates displayed are not the ones containing minDate even if I update the date also.

EDIT: 4. I found another use case which can be seen on the online demo page. If you select a date from the picker and then you try to change it from the input, the value does not update. These type of things seem to happen when you first select or set a value for your date and then you try to update another prop or something.

Additional information

All the values in my state are updating accordingly. It's my first time using this component so maybe there is something I'm missing. I'm using react hooks v 17.0.2 and latest version of this module. Any info or help on this is very appreciated.

Thanks a lot!

MarinaGhe avatar Apr 20 '22 17:04 MarinaGhe

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

github-actions[bot] avatar Jul 25 '22 00:07 github-actions[bot]

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Aug 15 '22 01:08 github-actions[bot]