-
-
Notifications
You must be signed in to change notification settings - Fork 73
Sorting sorts ascending first and displays correct icon #164
Conversation
src/dash-table/Table.js
Outdated
|
||
isBackEnd(value) { | ||
return ['be', false].indexOf(value) !== -1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't really part of the issue this PR fixes, but it's a nice fix anyway. Note that the way we have our webpack and babel configs set up now, using arrow functions as class methods throws an error upon building, hence the .bind(this)
syntax, which we should get rid of at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above in metadata.json, otherwise 👍
@@ -18,7 +18,7 @@ describe('select row', () => { | |||
it('select, sort, new row is not selected', () => { | |||
DashTable.getSelect(0).within(() => cy.get('input').click()); | |||
DashTable.getSelect(0).within(() => cy.get('input').should('be.checked')); | |||
cy.get('tr th.column-0 .sort').last().click({ force: true }); | |||
cy.get('tr th.column-0 .sort').last().click({ force: true }).click({ force: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double-click to sort twice so the values actually change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, this is the only case where it matters throughout the existing tests as here the derived_viewport_data was still in the same order as the original data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chriddyp I included the test bundle, which I didn't know was different, my mistake. Rebuild it, should be good now! |
## RC7 - Sort ascending on first click | ||
- Sorts ascending when first clicked | ||
- Flips icons displayed so that they are pointing up on ascending and down on descending. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include a link to the issue here since we have it.
dash_table/metadata.json
Outdated
], | ||
"returns": null | ||
} | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I think that's exactly why I defined this methods in the render function originally!
Since they do not require 'this' they could be moved outside the class entirely, solving this issue as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- merge with master
- rework isFrontEnd / isBackEnd change so as to keep metadata.json file clean
Closes #118 - this flips the icons so that they display down-arrow on descending, and up arrow on ascending, and selects ascending sort at first click.