Skip to content

DataTable: Pagination stops working when a column filter is applied #1388

Closed
@rvstanchev

Description

@rvstanchev

I'm submitting a ...

[x] bug report

CodeSandbox Case (Bug Reports)
Demo:
https://codesandbox.io/s/frosty-dubinsky-j8zvo
https://j8zvo.csb.app/
The provided demo shows a table with 32 rows.
Showing page other than the first one is not possible when a filter is applied.

Current behavior
In versions higher than 2.4.0 pagination (changing pages) of DataTable doesn't work when a filter is applied.

Initially pagination is working (because there's no filter applied). However if we apply a filter which results in more than one page of filtered results - pagination stops working (first page is shown and other pages can not be selected).

Note: This bug has been previously reported with issue #1305 but the proposed fix didn't resolve it.

Expected behavior
Users should be able to see paginated results when clicking on corresponding page buttons with or without filter applied.

Minimal reproduction of the problem with instructions
Steps to reproduce (using the provided codesandbox demo):

  1. Initial load - pagination is working.
  2. Apply a filter resulting in at least two pages (for example "1" - the letter for number one).
  3. Table shows paginated results (total of 13 results, split into two pages).
  4. As long as filter is applied, pages can not be selected (first page always stays on screen).
  5. The only way we can make the pagination work is to clear the filter (use "clear filter" button).

Last version in which pagination with applied filter works is 2.4.0.

Demo:

https://codesandbox.io/s/frosty-dubinsky-j8zvo

What is the motivation / use case for changing the behavior?
The described bug seriously and negatively impacts UX.

Please tell us about your environment:

  • Vue version: 2.6.14
  • PrimeVue version: 2.4.2
  • Browser: Reproduced in Chrome 91.0, Firefox 90.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions