Skip to content

Column filter for not working when first value in data is null #4711

Description

@tacomanator

Describe the bug

The column filter does not work properly if the first record is null for the column. No records match the query, despite other records having a value which would otherwise match. If the first value is defined, the column filtering works as expected.

In the example, random data is created such that column a is never null, b is sometimes null, and c is usually null. Filtering on column a always works. However, filtering on column b or c works depending on if the first value is null or not.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/muddy-rain-bj2j7d

Steps to reproduce

  1. Go to example
  2. Try filtering column a (works as expected)
  3. Verify that column b has value in first row (if not, refresh)
  4. Try filtering column b on a value in the column (works as expected)
  5. Verify that column c has value in first row (if not, refresh)
  6. Try filtering column c on a value in the column, row will not match

Expected behavior

Filtering for a column works even if the column has a null value in the first row.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

Mac, Chrome Version 109.0.5414.119 (Official Build) (arm64)

react-table version

8.7.9

TypeScript version

4.9.5

Additional context

No response

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.

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