Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(Table): fix sort issue in TableExampleSortable #4097

Merged
merged 2 commits into from
Nov 24, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed issue with sorting, not working on <Table> component, after the…
… first sort-click. Inside the state, data array is now immutable with the addition of .slice()
  • Loading branch information
Pechlivanis Dimitrios committed Nov 1, 2020
commit b25dc141195b75e46c1fa5a6513c37c2569a9fcc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function exampleReducer(state, action) {
if (state.column === action.column) {
return {
...state,
data: state.data.reverse(),
data: state.data.slice().reverse(),
direction:
state.direction === 'ascending' ? 'descending' : 'ascending',
}
Expand Down