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

Component: P-Table's state pagination does not restore if signal's initial value is '[]' #16513

Open
ross1296 opened this issue Oct 10, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@ross1296
Copy link

ross1296 commented Oct 10, 2024

Describe the bug

I am using PrimeNG for tables (p-table) with the built in session state, and NgRx SignalStore's withEntities(). I perform a HTTP request and then patch the entity state with the result.

I then use the signal to populate the table, like so: [value]="store.entities()"

The issue is that the default/initial value of withEntities()'s entities() signal is []

When PrimeNG goes to restore the state, the pagination is not restored because of this. So if I was on page 3, navigate away and come back to the table, it goes back to page 1. Column sorts and filters are maintained.

This issue does not happen if the initital value is undefined, but the default value of withEntities()'s entities() signal cannot be changed and is, by design, suppose to be [].

Environment

  • "primeng": "^17.18.9",
  • "@ngrx/signals": "^18.0.2",

Reproducer

No response

Angular version

18.2.2

PrimeNG version

17.18.9

Build / Runtime

TypeScript

Language

TypeScript

Node version (for AoT issues node --version)

20.16.0

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@ross1296 ross1296 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 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant