Skip to content

Commit

Permalink
Merge pull request #995 from bkiac/fix-on-column-sort-change-label
Browse files Browse the repository at this point in the history
Refactor column direction conversion
  • Loading branch information
patorjk committed Jun 2, 2020
2 parents 1a3abe3 + 8a37936 commit d942865
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MUIDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ class MUIDataTable extends React.Component {
);
};

getSortDirection(column) {
getSortDirectionLabel(column) {
return column.sortDirection === 'asc' ? 'ascending' : 'descending';
}

Expand Down Expand Up @@ -966,7 +966,7 @@ class MUIDataTable extends React.Component {
}
}

const orderLabel = this.getSortDirection(columns[index]);
const orderLabel = this.getSortDirectionLabel(columns[index]);
const announceText = `Table now sorted by ${columns[index].name} : ${orderLabel}`;

let newState = {
Expand Down Expand Up @@ -1001,7 +1001,7 @@ class MUIDataTable extends React.Component {
if (this.options.onColumnSortChange) {
this.options.onColumnSortChange(
this.state.columns[index].name,
this.getSortDirection(this.state.columns[index]),
this.state.columns[index].sortDirection,
);
}
},
Expand Down

0 comments on commit d942865

Please sign in to comment.