Skip to content

Commit

Permalink
Merge pull request #130 from Anjalbaral/multi-order-table-sort
Browse files Browse the repository at this point in the history
Some enhancements to mult-order table sort
  • Loading branch information
melalj authored Jun 14, 2024
2 parents c21fb52 + f40ace2 commit b9fa8c0
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 37 deletions.
2 changes: 1 addition & 1 deletion dist/maptable.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

153 changes: 128 additions & 25 deletions dist/maptable.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/maptable.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/maptable.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion docs/maptable.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/maptable.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/components/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ export default class Table {
const primarySort = this.sorting[0].key || '';
if (data[index] && data[index + 1]) {
if (data[index][primarySort] && data[index + 1][primarySort]) {
return data[index][primarySort].toLowerCase() !== data[index + 1][primarySort].toLowerCase();
// stringify everything before .toLowerCase()
return `${data[index][primarySort]}`.toLowerCase() !== `${data[index + 1][primarySort]}`.toLowerCase();
}
}
return false;
Expand Down

0 comments on commit b9fa8c0

Please sign in to comment.