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

Table: Sorting is not restored when using stateful table and presort #16551

Open
aberonni opened this issue Oct 15, 2024 · 0 comments
Open

Table: Sorting is not restored when using stateful table and presort #16551

aberonni opened this issue Oct 15, 2024 · 0 comments
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Milestone

Comments

@aberonni
Copy link
Contributor

Describe the bug

When using the p-table component:

  • With a default presort with sortField and/or sortOrder
  • And a [stateful table] by defining stateKey

The table does not maintain custom sorting upon page reload.

Environment

Irrelevant (reproducible consistently on stackblitz)

Reproducer

https://stackblitz.com/edit/g3lsdy?file=src%2Fapp%2Ftable-stateful-demo.html

Angular version

18.1.1

PrimeNG version

17.18.9

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.11.1

Browser(s)

No response

Steps to reproduce the behavior

  1. Define a default presort with sortField and/or sortOrder
  2. Define a [stateful table] by defining stateKey
  3. Upon page load, change the sort field order by clicking on a different column header than the default one
  4. Reload the page

Expected behavior

The new sort field / order defined in step 3. should be maintained upon page reload. Instead, the default presort is always applied upon page reload.

@aberonni aberonni added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 15, 2024
@mertsincan mertsincan added this to the 17.18.13 milestone Nov 19, 2024
@mertsincan mertsincan added Status: Pending Review Issue or pull request is being reviewed by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 19, 2024
@mertsincan mertsincan modified the milestones: 17.18.13, 17.x Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
Status: No status
Development

No branches or pull requests

2 participants