Skip to content

Commit

Permalink
Merge pull request #98 from prssanna/sort-fix
Browse files Browse the repository at this point in the history
fix: πŸ› set content of empty cell to empty string for sorting
  • Loading branch information
mergify[bot] authored Mar 16, 2020
2 parents 3475f6c + 18964c0 commit c263ab4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/datamanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,11 @@ export default class DataManager {
this.rowViewOrder.sort((a, b) => {
const aIndex = a;
const bIndex = b;
const aContent = this.getCell(colIndex, a).content;
const bContent = this.getCell(colIndex, b).content;

let aContent = this.getCell(colIndex, a).content;
let bContent = this.getCell(colIndex, b).content;
aContent = aContent == null ? '' : aContent;
bContent = bContent == null ? '' : bContent;

if (sortOrder === 'none') {
return aIndex - bIndex;
Expand Down

0 comments on commit c263ab4

Please sign in to comment.