Skip to content

Commit 35f494c

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 4c5f6de commit 35f494c

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
@@ -377,7 +377,7 @@ export declare class MatEndDate<D> extends _MatDateRangeInputBase<D> implements
377377
ngDoCheck(): void;
378378
ngOnInit(): void;
379379
static ngAcceptInputType_disabled: BooleanInput;
380-
static ɵdir: i0.ɵɵDirectiveDefWithMeta<MatEndDate<any>, "input[matEndDate]", never, {}, {}, never>;
380+
static ɵdir: i0.ɵɵDirectiveDefWithMeta<MatEndDate<any>, "input[matEndDate]", never, {}, { "dateChange": "dateChange"; "dateInput": "dateInput"; }, never>;
381381
static ɵfac: i0.ɵɵFactoryDef<MatEndDate<any>, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
382382
}
383383

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

0 commit comments

Comments
 (0)