Skip to content

Change sort button to display both sorting directions at the same time. #88

Merged
merged 7 commits into from
Oct 30, 2020

Conversation

wrigh393
Copy link
Collaborator

No description provided.

@campb303
Copy link
Collaborator

As this is implemented now, no matter which arrow I click on, the top arrow is selected first, then the bottom, then they are disabled. This functionality should instead be two independent toggles that behave like this:

  • When no sorting is active, a click on an arrow should sort the table based on the direction of that arrow.
  • When one sort is active, a click on the opposite arrow should deactivate the current sort and activate the opposite sort. The UI should change accordingly.
  • When one sort is active, a clock on the corresponding sort should deactivate the currentsort. The UI should change accordingly.

Copy link
Collaborator

@campb303 campb303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment in the conversation view.

@wrigh393
Copy link
Collaborator Author

By implementing an onClick event to the <IconButton> components we were able to get the buttons to allow users to sort the table based on the direction of the icon they selected. This was necessary because react-table does not have the ability to set sort direction built into the getSortByToggle() props.

@@ -19,6 +20,11 @@ export default function ItemTable({ data, onRowClick }) {
inactiveSortIcon: {
opacity: 0.2,
},
selectedItem: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for row selection?

@wrigh393 wrigh393 merged commit da2592d into staging Oct 30, 2020
@wrigh393 wrigh393 deleted the Enhancement-ItemTable-sortButton branch October 30, 2020 16:54
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants