We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b259a6 commit 9d07913Copy full SHA for 9d07913
src/lib/table/table-data-source.ts
@@ -123,9 +123,14 @@ export class MatTableDataSource<T> implements DataSource<T> {
123
124
let comparatorResult = 0;
125
if (valueA && valueB) {
126
- comparatorResult = valueA < valueB ? -1 : 1;
+ // Check if one value is greater than the other; if equal, comparatorResult should remain 0.
127
+ if (valueA < valueB) {
128
+ comparatorResult = -1;
129
+ } else if (valueB < valueA) {
130
+ comparatorResult = 1;
131
+ }
132
} else if (valueA) {
- comparatorResult = 1;
133
134
} else if (valueB) {
135
comparatorResult = -1;
136
}
0 commit comments