Skip to content

Optional typing of MatSelectChange #30324

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

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/material/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ export const MAT_SELECT_SCROLL_STRATEGY_PROVIDER = {
export const MAT_SELECT_TRIGGER = new InjectionToken<MatSelectTrigger>('MatSelectTrigger');

/** Change event object that is emitted when the select value has changed. */
export class MatSelectChange {
export class MatSelectChange<T = any> {
constructor(
/** Reference to the select that emitted the change event. */
public source: MatSelect,
/** Current value of the select that emitted the event. */
public value: any,
public value: T,
) {}
}

Expand Down
8 changes: 4 additions & 4 deletions tools/public_api_guard/material/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class MatSelect implements AfterContentInit, OnChanges, OnDestroy, OnInit
_scrollOptionIntoView(index: number): void;
_scrollStrategy: ScrollStrategy;
get selected(): MatOption | MatOption[];
readonly selectionChange: EventEmitter<MatSelectChange>;
readonly selectionChange: EventEmitter<MatSelectChange<any>>;
_selectionModel: SelectionModel<MatOption>;
setDescribedByIds(ids: string[]): void;
setDisabledState(isDisabled: boolean): void;
Expand Down Expand Up @@ -223,12 +223,12 @@ export const matSelectAnimations: {
};

// @public
export class MatSelectChange {
export class MatSelectChange<T = any> {
constructor(
source: MatSelect,
value: any);
value: T);
source: MatSelect;
value: any;
value: T;
}

// @public
Expand Down
Loading