Skip to content

bug(MatDateRangePicker): Dates set in illogical order and more than necessary #21847

Closed
@mcalmus

Description

@mcalmus

Reproduction

https://stackblitz.com/edit/components-issue-uosggb?file=src%2Fapp%2Fexample-component.html

Steps to reproduce:

  1. Open Date Picker
  2. Choose beginning date
  3. Choose ending date
    4-6. Repeat steps 1-3

Expected Behavior

Steps 3,6: End date set, beginning date not set
Step 5: End date cleared, beginning date set

Actual Behavior

Steps 3,6: Both beginning date and end date set
Step 5: Beginning date set before end date is cleared

The behavior in steps 3 and 6 causes extra calls that are unnecessary and makes an app check for "changes" that do not modify the value before performing extra operations.
The behavior in step 5 makes the control briefly have a date range that is different than it actually does. In the case where some action is performed when both values are set, it appears they are both set when actually only the start date is set.

Environment

  • Angular: 11
  • CDK/Material: 11
  • Browser(s): all
  • Operating System (e.g. Windows, macOS, Ubuntu): all

Metadata

Metadata

Assignees

Labels

P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: material/datepicker

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions