Skip to content

Commit 211d2b2

Browse files
willbeaufoyandrewseguin
authored andcommitted
Fix misleading comment in sortData() (#17176)
The comment says that the sort function will sort existing values before null/undefined values. However the code does the opposite.
1 parent 1e74db9 commit 211d2b2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class MatTableDataSource<T> extends DataSource<T> {
149149
let valueB = this.sortingDataAccessor(b, active);
150150

151151
// If both valueA and valueB exist (truthy), then compare the two. Otherwise, check if
152-
// one value exists while the other doesn't. In this case, existing value should come first.
152+
// one value exists while the other doesn't. In this case, existing value should come last.
153153
// This avoids inconsistent results when comparing values to undefined/null.
154154
// If neither value exists, return 0 (equal).
155155
let comparatorResult = 0;

0 commit comments

Comments
 (0)