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

Bug: Search and/or Sort being enabled causes initial page setting to be ignored and is set to 1st page. #1471

Open
tjblue opened this issue Aug 6, 2024 · 1 comment

Comments

@tjblue
Copy link

tjblue commented Aug 6, 2024

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Build Grid without sort or search enabled.
  2. Enable a different initial page on render with pagination config: pagination: {limit: 1, page: 1} // page: 1 sets rendered page to 2
  3. Observe that grid does render on 2nd page.
  4. Enable search and/or sort. search: true, sort: true
  5. Observe grid does not render on page 2. Renders to page 1.

Expected behavior
Search and Sort should not affect the initial page setting.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Edge
  • Version: 127.0.2651.86 (Official build) (64-bit)

Additional context
Add any other context about the problem here.

@tjblue tjblue changed the title Search and/or Sort being enabled causes initial page setting to be ignored and is set to 1st page. Bug: Search and/or Sort being enabled causes initial page setting to be ignored and is set to 1st page. Aug 6, 2024
@tjblue
Copy link
Author

tjblue commented Aug 6, 2024

Did some more investigating. The pagination config includes all these options

  limit?: number;
  page?: number;
  summary?: boolean;
  nextButton?: boolean;
  prevButton?: boolean;
  buttonsCount?: number;
  resetPageOnUpdate?: boolean;
  server?: {
    url?: (prevUrl: string, page: number, limit: number) => string;
    body?: (prevBody: BodyInit, page: number, limit: number) => BodyInit;
  };
}

I was able to enable search and use page: number by using resetPageOnUpdate: false in pagination. However this does not change the case for sort. If sort: true anywhere in grid config it will not allow the initial page to be set.

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

No branches or pull requests

1 participant