Skip to content

filter is not working #5889

Open
Open
@Hassanabdelqader

Description

@Hassanabdelqader

TanStack Table version

pnpm ^8.20.6

Framework/Library version

next ^15.1.3

Describe the bug and the steps to reproduce it

When implementing manual server-side pagination, an issue arises when applying a filter while not on the first page. The pagination resets as expected, but the filter value does not update correctly. However, when on the first page, the filter functions as intended.

The problem seems to stem from the setFilterValue function provided by the column. This function appears to perform two actions simultaneously: resetting the pagination and setting the filter value. Due to this simultaneous operation, a conflict occurs, preventing the filter from applying correctly.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

<FloatingLabelInput type={column.inputType ?? 'text'} label={column.label} value={(table.getColumn(String(column.value))?.getFilterValue() as string) || ''} onChange={(event) => { console.log({ event }); setTimeout(() => { table.resetPagination(); }, 0); table.getColumn(String(column.value))?.setFilterValue(event.target.value); }} classNameLabel="text-sm" className="h-12 w-full" showClearIcon={ column.showClearIcon && (table.getColumn(String(column.value))?.getFilterValue() as string) ? ( ) : undefined } />

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions