diff --git a/build/reactable.js b/build/reactable.js index f4a7b148..0c80f042 100644 --- a/build/reactable.js +++ b/build/reactable.js @@ -1181,9 +1181,9 @@ window.ReactDOM["default"] = window.ReactDOM; }, { key: 'updateCurrentSort', value: function updateCurrentSort(sortBy) { - if (sortBy !== false && sortBy.column !== this.state.currentSort.column && sortBy.direction !== this.state.currentSort.direction) { + if (sortBy !== false && (sortBy.column !== this.state.currentSort.column || sortBy.direction !== this.state.currentSort.direction)) { - this.setState({ currentSort: this.getCurrentSort(sortBy) }); + this.state.currentSort = this.getCurrentSort(sortBy); } } }, { diff --git a/lib/reactable/table.js b/lib/reactable/table.js index ccc3c079..0bac92de 100644 --- a/lib/reactable/table.js +++ b/lib/reactable/table.js @@ -234,9 +234,9 @@ var Table = (function (_React$Component) { }, { key: 'updateCurrentSort', value: function updateCurrentSort(sortBy) { - if (sortBy !== false && sortBy.column !== this.state.currentSort.column && sortBy.direction !== this.state.currentSort.direction) { + if (sortBy !== false && (sortBy.column !== this.state.currentSort.column || sortBy.direction !== this.state.currentSort.direction)) { - this.setState({ currentSort: this.getCurrentSort(sortBy) }); + this.state.currentSort = this.getCurrentSort(sortBy); } } }, { diff --git a/src/reactable/table.jsx b/src/reactable/table.jsx index 1278ba16..fc3d94d0 100644 --- a/src/reactable/table.jsx +++ b/src/reactable/table.jsx @@ -194,10 +194,10 @@ export class Table extends React.Component { updateCurrentSort(sortBy) { if (sortBy !== false && - sortBy.column !== this.state.currentSort.column && - sortBy.direction !== this.state.currentSort.direction) { + (sortBy.column !== this.state.currentSort.column || + sortBy.direction !== this.state.currentSort.direction)) { - this.setState({ currentSort: this.getCurrentSort(sortBy) }); + this.state.currentSort = this.getCurrentSort(sortBy) } }