Can't select single-day range on multirange selection #2340
Labels
date range picker
Date range picker component
waiting for customer response
Cannot make further progress until the customer responds.
Use case
The current behavior of the date picker does not allow users to select a date range that spans only a single day. When a user clicks on May 5th to set the start date, and then clicks again on May 5th to also set it as the end date, followed by a click on May 7th, the picker resets the selection. Instead of interpreting the first two clicks as defining a one-day range (May 5th–May 5th), it treats the second click on May 5th as a new start date, and then the third click on May 7th as the end date. This results in an unintended selection of May 5th–May 7th. The expected behavior is for the second click on the same date to confirm a single-day range, rather than resetting the selection process.
Proposal
I understand that in some scenarios disallowing single-day ranges is acceptable, but other scenarios (such as mine) are essential having it as a feature.
I detected where that happens (at least in multirange selection): method
void _drawRangesSelectionForMonth(dynamic)
of class_PickerViewState
. My working solution is:My proposal is to add
allowSingleDaySelection
as a parameter ofSfDateRangePicker
, to make it easier to turn it on and off.The text was updated successfully, but these errors were encountered: