File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ describe('DataTable: ', function() {
374
374
describe ( 'Sortable' , function ( ) {
375
375
afterEach ( removeTable ) ;
376
376
377
- it ( 'first clicked on sortable column header should result in ascending sort' , function ( done ) {
377
+ it ( 'first clicked on sortable column header should result in ascending sort by default ' , function ( done ) {
378
378
this . onSort = ( data ) => {
379
379
data . property . should . equal ( 'count' ) ;
380
380
data . sortDirection . should . equal ( 'asc' ) ;
Original file line number Diff line number Diff line change @@ -104,11 +104,10 @@ class DataTableHeaderCell extends React.Component {
104
104
handleSort = ( e ) => {
105
105
const oldSortDirection =
106
106
this . props . sortDirection || this . state . sortDirection ;
107
- // var sortDirection = this.props.firstSortDirection
108
- // if (oldSortDirection) {
109
- // sortDirection = oldSortDirection === 'asc' ? 'desc' : 'asc'
110
- // }
111
- const sortDirection = oldSortDirection ? ( oldSortDirection === 'asc' ? 'desc' : 'asc' ) : ( this . props . firstSortDirection )
107
+ var sortDirection = this . props . firstSortDirection
108
+ if ( oldSortDirection ) {
109
+ sortDirection = oldSortDirection === 'asc' ? 'desc' : 'asc'
110
+ }
112
111
const data = {
113
112
property : this . props . property ,
114
113
sortDirection,
You can’t perform that action at this time.
0 commit comments