Skip to content

Commit a112af0

Browse files
committed
fix: use 0 for falsy number progress values during sorting
Signed-off-by: Cleopatra Enjeck M <patrathewhiz@gmail.com>
1 parent 541da84 commit a112af0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shared/components/ncTable/mixins/columnsTypes/numberProgress.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export default class NumberProgressColumn extends AbstractNumberColumn {
1616
sort(mode, nextSorts) {
1717
const factor = mode === 'DESC' ? -1 : 1
1818
return (rowA, rowB) => {
19-
const tmpA = rowA.data.find(item => item.columnId === this.id)?.value || null
19+
const tmpA = rowA.data.find(item => item.columnId === this.id)?.value || 0
2020
const valueA = parseInt(tmpA)
21-
const tmpB = rowB.data.find(item => item.columnId === this.id)?.value || null
21+
const tmpB = rowB.data.find(item => item.columnId === this.id)?.value || 0
2222
const valueB = parseInt(tmpB)
2323
return ((valueA < valueB) ? -1 : (valueA > valueB) ? 1 : 0) * factor || super.getNextSortsResult(nextSorts, rowA, rowB)
2424
}

0 commit comments

Comments
 (0)