ant-design RangePicker if end date is before start date, should set start date to end date and keep focus in end date

4sup72z8  于 2022-12-31  发布在  其他
关注(0)|答案(1)|浏览(172)

Steps to reproduce

  1. Add a start date (07/20/2022)
  2. Add an end date (07/22/2022)
  3. Edit the end date to be before the start date (end date -> 07/01/2022)
  4. Notice the start date is set to the end date but still requires another click to set the date. (In our onCalendarChange we set the start date to be the end date if the end date is before the start date)
  5. However the start date isn't actually set and the cursor remains in the start date

What is expected?

If the date values are set programmatically, the values get set and the cursors input is based on the values. If we programmatically set the start date, the cursor would be in the end input.

What is actually happening?

The cursor does not change locations based on values set. When the date values are set, an extra click is needed to actually set the start value.

EnvironmentInfo
antd4.21.7
React17.02
SystemMac
BrowserChrome

We are trying to reduce the number of clicks a user needs to take for editing in new dates. If a user changes any of the dates, we want the range picker to be responsive enough based on what dates they choose. A similar user experience as other range picker libraries such as: https://react-dates.github.io/react-dates/?path=/story/daterangepicker-drp--default

pexxcrt2

pexxcrt21#

Just wanted to say we have the exact same issue, it's confusing our users a lot, we had to reverse to 2 separate components for now to avoid confusion.

The issue is even more noticeable with the RangePicker with Day + hours selection.

It would be greatly appreciated to have an option to stop the automatic switch between start and end date :)

相关问题