Skip to content

Commit

Permalink
Merge pull request #126 from MagicAardvark/master
Browse files Browse the repository at this point in the history
Use the current sort order when switching sorted column if defined
  • Loading branch information
matthewoestreich authored Mar 30, 2021
2 parents 3cc196e + a64c4a6 commit 2dfe4e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/MTableHeader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function MTableHeader(props) {
onClick={() => {
const orderDirection =
columnDef.tableData.id !== props.orderBy
? 'asc'
? props.orderDirection || 'asc' // use the current sort order when switching columns if defined
: props.orderDirection === 'asc'
? 'desc'
: props.orderDirection === 'desc' && props.thirdSortClick
Expand Down

0 comments on commit 2dfe4e7

Please sign in to comment.