Fix the table sorting order bug for numerical values (#2587)

* Fix the table sorting order bug for numerical values.

* Addressed @davkal's comment.
This commit is contained in:
Filip Barl
2017-06-19 12:42:33 +02:00
committed by GitHub
parent e42347addc
commit fd8f9be9cb

View File

@@ -202,7 +202,8 @@ export default class NodeDetailsTable extends React.Component {
const sortedBy = this.state.sortedBy || getDefaultSortedBy(columns, this.props.nodes);
const sortedByHeader = this.getColumnHeaders().find(h => h.id === sortedBy);
const sortedDesc = this.state.sortedDesc || defaultSortDesc(sortedByHeader);
const sortedDesc = (this.state.sortedDesc === null) ?
defaultSortDesc(sortedByHeader) : this.state.sortedDesc;
let nodes = getSortedNodes(this.props.nodes, sortedByHeader, sortedDesc);