Skip to content

Commit 63d9364

Browse files
crisbetoannieyw
authored andcommitted
fix(material/datepicker): range input emitters not picked up by language service (#20937)
The `dateChange` and `dateInput` outputs are inherited through a mixin which seems to prevent the language service from picking them up. These changes add extra hints to the component metadata. Fixes #20932. (cherry picked from commit 57a3661)
1 parent cc32c5d commit 63d9364

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@ const _MatDateRangeInputBase:
195195
providers: [
196196
{provide: NG_VALUE_ACCESSOR, useExisting: MatStartDate, multi: true},
197197
{provide: NG_VALIDATORS, useExisting: MatStartDate, multi: true}
198-
]
198+
],
199+
// These need to be specified explicitly, because some tooling doesn't
200+
// seem to pick them up from the base class. See #20932.
201+
outputs: ['dateChange', 'dateInput']
199202
})
200203
export class MatStartDate<D> extends _MatDateRangeInputBase<D> implements
201204
CanUpdateErrorState, DoCheck, OnInit {
@@ -301,7 +304,10 @@ export class MatStartDate<D> extends _MatDateRangeInputBase<D> implements
301304
providers: [
302305
{provide: NG_VALUE_ACCESSOR, useExisting: MatEndDate, multi: true},
303306
{provide: NG_VALIDATORS, useExisting: MatEndDate, multi: true}
304-
]
307+
],
308+
// These need to be specified explicitly, because some tooling doesn't
309+
// seem to pick them up from the base class. See #20932.
310+
outputs: ['dateChange', 'dateInput']
305311
})
306312
export class MatEndDate<D> extends _MatDateRangeInputBase<D> implements
307313
CanUpdateErrorState, DoCheck, OnInit {

tools/public_api_guard/material/datepicker.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export declare class MatEndDate<D> extends _MatDateRangeInputBase<D> implements
380380
ngDoCheck(): void;
381381
ngOnInit(): void;
382382
static ngAcceptInputType_disabled: BooleanInput;
383-
static ɵdir: i0.ɵɵDirectiveDefWithMeta<MatEndDate<any>, "input[matEndDate]", never, {}, {}, never>;
383+
static ɵdir: i0.ɵɵDirectiveDefWithMeta<MatEndDate<any>, "input[matEndDate]", never, {}, { "dateChange": "dateChange"; "dateInput": "dateInput"; }, never>;
384384
static ɵfac: i0.ɵɵFactoryDef<MatEndDate<any>, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
385385
}
386386

@@ -490,7 +490,7 @@ export declare class MatStartDate<D> extends _MatDateRangeInputBase<D> implement
490490
ngDoCheck(): void;
491491
ngOnInit(): void;
492492
static ngAcceptInputType_disabled: BooleanInput;
493-
static ɵdir: i0.ɵɵDirectiveDefWithMeta<MatStartDate<any>, "input[matStartDate]", never, {}, {}, never>;
493+
static ɵdir: i0.ɵɵDirectiveDefWithMeta<MatStartDate<any>, "input[matStartDate]", never, {}, { "dateChange": "dateChange"; "dateInput": "dateInput"; }, never>;
494494
static ɵfac: i0.ɵɵFactoryDef<MatStartDate<any>, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
495495
}
496496

0 commit comments

Comments
 (0)