Skip to content

Commit

Permalink
ViewActions: do not allow unset sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 11, 2023
1 parent ee800e6 commit 18f483d
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions packages/dataviews/src/view-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,22 +232,13 @@ function SortMenu( { fields, view, onChangeView } ) {
}
onSelect={ ( event ) => {
event.preventDefault();
if (
sortedDirection === direction
) {
onChangeView( {
...view,
sort: undefined,
} );
} else {
onChangeView( {
...view,
sort: {
field: field.id,
direction,
},
} );
}
onChangeView( {
...view,
sort: {
field: field.id,
direction,
},
} );
} }
>
{ info.label }
Expand Down

0 comments on commit 18f483d

Please sign in to comment.