react-magma icon indicating copy to clipboard operation
react-magma copied to clipboard

DatePicker: Date disappears if user enters a valid date, then changes it to an invalid date

Open silvalaura opened this issue 1 year ago • 0 comments

Describe the bug When using date picker with a min or max date, the date entered by a user disappears if manually entered after a valid date has been present before it.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://next--upbeat-sinoussi-f675aa.netlify.app/api/date-pickers/#minimum_and_maximum_dates
  2. Click on the picker and pick any date
  3. Now try entering an invalid date (01/07/2020) manually
  4. Notice the date disappeared

Also notice that if you try just entering an invalid date (before adding one from the calendar), it does not disappear. This happens with both a date before the min date or after the max date.

Expected behavior The date does not disappear. The date will remain in the input and there will be validation to ask the user to enter a date within the range.

Additional context Example of how it's handled in another system: https://react-spectrum.adobe.com/react-spectrum/DatePicker.html#minimum-and-maximum-values

silvalaura avatar Apr 22 '24 16:04 silvalaura