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

Sortable table is persistent #259

Open
liammcmurray opened this issue Sep 20, 2021 · 1 comment
Open

Sortable table is persistent #259

liammcmurray opened this issue Sep 20, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@liammcmurray
Copy link

Summary

Make the sorted data of a sortable table (https://design-patterns.service.justice.gov.uk/components/sortable-table/) stay sorted for the duration of a user's session.

Motivation

Users interacting with a sorted table refer back to it as part of task completion, and expectation is that it remains in the state they left it in.

Describe alternatives you've considered

Users can re-sort, but this is not a great user experience. It would be much better for work done not to be 'undone' in this instance.

Additional context

The persistent pattern is particularly necessary where the sortable table contains links, as users get 'lost' when returning to the screen.

@liammcmurray liammcmurray added the enhancement New feature or request label Sep 20, 2021
@gregtyler
Copy link
Contributor

We could add a persistent option to sortable (so that it's not default behaviour, for backwards compatibility) that:

  • Stores the column and sort order whenever the table is sorted
  • Uses the stored column and order when the page is loaded

We'd need the user to pass in an ID to store it under so that if there are multiple Sortables in an application they don't all persist with the same setting (but by sharing an ID, you could link two identical-in-practice tables).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants