-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
fix(datepicker): not updating calendar state if input changes while open #19973
fix(datepicker): not updating calendar state if input changes while open #19973
Conversation
@@ -154,7 +155,7 @@ export class MatDateRangeInput<D> implements MatFormFieldControl<DateRange<D>>, | |||
|
|||
if (newValue !== this._groupDisabled) { | |||
this._groupDisabled = newValue; | |||
this._disabledChange.next(this.disabled); | |||
this._stateChanges.next(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of upcoming rxjs changes we always want to be passing something to next
now, e.g. next(null)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to next(undefined)
since some of these are implemented due to MatFormFieldControl
which requires a stateChanges: Observable<void>
.
The feedback has been addressed. |
The datepicker was only updating the calendar state that depends on the input when we open and close. I've reworked it so we do it any time one of the input's inputs changes. I also renamed the various `_disabledChange` streams to `_stateChanges` which aligns with what we're doing in other components. Fixes angular#19959.
40b3dc9
to
07d5152
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…pen (#19973) The datepicker was only updating the calendar state that depends on the input when we open and close. I've reworked it so we do it any time one of the input's inputs changes. I also renamed the various `_disabledChange` streams to `_stateChanges` which aligns with what we're doing in other components. Fixes #19959. (cherry picked from commit af6b538)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The datepicker was only updating the calendar state that depends on the input when we open and close. I've reworked it so we do it any time one of the input's inputs changes. I also renamed the various
_disabledChange
streams to_stateChanges
which aligns with what we're doing in other components.Fixes #19959.