Skip to content

Commit

Permalink
Refactor onColumnSortChange args and sort direction label
Browse files Browse the repository at this point in the history
  • Loading branch information
bkiac committed Oct 10, 2019
1 parent b8bee52 commit 8a37936
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 @@ -824,7 +824,7 @@ class MUIDataTable extends React.Component {
);
};

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

Expand All @@ -843,7 +843,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 @@ -878,7 +878,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 8a37936

Please sign in to comment.