Skip to content

Global Filter causes getFilteredRowModel to be empty #5010

@Rudedog9d

Description

@Rudedog9d

Environment



Is this bug related to Nuxt or Vue?

Nuxt

Package

v3.x

Version

v3.3.2

Reproduction

https://codesandbox.io/p/sandbox/cool-tree-539lz5

This example should be broke on page load. If you remove :globalFilter="filter", then refresh the preview, you can see the pagination initialize correctly.

I have included a watch console.log for the total, which represents the value of tableApi?.getFilteredRowModel().rows.length

Description

There is a bug with either NuxtUI Table, or Tanstack Table, when utilizing globalFilter and Pagination together. It seems that tableApi?.getFilteredRowModel().rows is not being initialized correctly.

When globalFilter is provided, the initial page load will not properly initialize the pagination total length using getFilteredRowModel, but when the globalFilter prop is removed from <UTable />, pagination initializes fine.

The pagination component also correctly updates if the filter is modified - it is ONLY a bug during the initial page load.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting initial review and prioritizationv3#1289

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions