Skip to content

Commit 701f2b7

Browse files
committed
fix(material/datepicker): date range input incorrectly inheriting text color (#26988)
Fixes that the MDC-based date range input was inheriting the text color instead of setting its own, because it was missing one of the MDC CSS classes. Fixes #26925. (cherry picked from commit 1fcbcac)
1 parent 2849d4a commit 701f2b7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/material/datepicker/date-range-input.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,11 @@ export class MatDateRangeInput<D>
270270
// The datepicker module can be used both with MDC and non-MDC form fields. We have
271271
// to conditionally add the MDC input class so that the range picker looks correctly.
272272
if (_formField?._elementRef.nativeElement.classList.contains('mat-mdc-form-field')) {
273-
const classList = _elementRef.nativeElement.classList;
274-
classList.add('mat-mdc-input-element');
275-
classList.add('mat-mdc-form-field-input-control');
273+
_elementRef.nativeElement.classList.add(
274+
'mat-mdc-input-element',
275+
'mat-mdc-form-field-input-control',
276+
'mdc-text-field__input',
277+
);
276278
}
277279

278280
// TODO(crisbeto): remove `as any` after #18206 lands.

0 commit comments

Comments
 (0)