Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] Keep initially set values of beginDate and endDate for datepicker #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AVykhrystyuk
Copy link

@AVykhrystyuk AVykhrystyuk commented Feb 26, 2020

Fix cases when datepickerInput._valueChange event happens earlier than @input() being set for rangeMode

Steps to reproduce the issue:

  • add the following markup
<input matInput [matRangeDatepicker]="rangePicker" formControlName="propertyWithDateRange">
<mat-range-datepicker #rangePicker [rangeMode]="true"></mat-range-datepicker>
<mat-range-datepicker-toggle matSuffix [for]="rangePicker"></mat-range-datepicker-toggle>
  • initialize propertyWithDateRange in the component constructor or use a property-initializer:
public propertyWithDateRange = { begin: new Date(), end: new Date() }
  • open date picker and click Cancel
    Actual result: Date field is empty
    Expected result: selected date is not changed when a user clicks on Cancel in date picker

Fix cases when `datepickerInput._valueChange` event happend earlier than @input() being set for `rangeMode`
@AVykhrystyuk AVykhrystyuk changed the title Fix/keep initially set beginDate and endDate in datepicker [Bugfix] Keep initially set values of beginDate and endDate for datepicker Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants