Merge pull request #98 from prssanna/sort-fix

fix: 🐛 set content of empty cell to empty string for sorting
This commit is contained in:
mergify[bot] 2020-03-16 09:35:23 +00:00 committed by GitHub
commit c263ab410e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;