Skip to content

Commit a603b14

Browse files
committed
feat(material/table): accept undefined sort and paginator
Extend types of the sort and paginator setter to include undefined to avoid `?? null` when using singals (e.g. `viewChild`).
1 parent a62164d commit a603b14

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/material/table/table-data-source.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ export class MatTableDataSource<T, P extends MatPaginator = MatPaginator> extend
107107
return this._sort;
108108
}
109109

110-
set sort(sort: MatSort | null) {
111-
this._sort = sort;
110+
set sort(sort: MatSort | null | undefined) {
111+
this._sort = sort ?? null;
112112
this._updateChangeSubscription();
113113
}
114114

@@ -128,8 +128,8 @@ export class MatTableDataSource<T, P extends MatPaginator = MatPaginator> extend
128128
return this._paginator;
129129
}
130130

131-
set paginator(paginator: P | null) {
132-
this._paginator = paginator;
131+
set paginator(paginator: P | null | undefined) {
132+
this._paginator = paginator ?? null;
133133
this._updateChangeSubscription();
134134
}
135135

0 commit comments

Comments
 (0)