Tradeshift / tradeshift-ui

The Tradeshift UI Library & Framework
https://ui.tradeshift.com
Other
33 stars 45 forks source link

[DatePicker] Able to select the date less than min date in some case #984

Open n-srg opened 3 years ago

n-srg commented 3 years ago

Describe the bug A user can select the date that is less than minimal in case the selected value was less than the minimal possible date.

To reproduce

  1. Go to https://ui.tradeshift.com/v12/#components/datepicker/ use the example 2
  2. see the min: '1984-01-01', and specify the value less than this date (I used value: '1983-01-01',)
  3. open the date picker. See you can select any date starting from the 1983-01-01. This conflicts with the minimum possible date which is 1984-01-01 (I can select 1983-02-02 for example)
  4. you can scroll until the minimum date, but AFTER you can not scroll back to the selected value

Expected behavior

  1. Expected to open the date picker on the first date available for selection (if the min is greater than selected date than date picker should be opened with the minimal date on the panel. otherwise - keep the current behavior (date picker opens with the focus on the selected date)
  2. Expected to be able to scroll back to the selected date, but all unavailable (because of min value) dates should be marked with strikethrough numbers

Additional context This bug was reported by one of our customers

Kian-Esmaeilpour commented 3 years ago

Thanks for reporting :) cc: @lauratanase