Skip to content

[v8] Global filter gives TypeError: l.toLowerCase is not a function when using number fields #4280

@marceloverdijk

Description

@marceloverdijk

Describe the bug

With latest 8.5.11 version using the Global filter in combination with number fields gives:

image

Note this was already raised in #4210 but still happens with latest version unfortunately.

I think this was introduced somewhere in 8.3.x line as I first encountered this while upgrading from 8.2.x to 8.3.3.

A workaround like

      {
        id: 'matches',
        header: 'Matches',
        accessorFn: (originalRow) => originalRow.matches.toString(), // matches is a number
        // accessorKey: 'matches', // this worked before
      },

seems to work for the filtering, but this would also impact the sorting I would assume. Sorting on a string value instead of the number value will have impact (1, 2, 10 vs 1, 10, 2).

Your minimal, reproducible example

.

Steps to reproduce

See above.

Expected behavior

Global filter to work with number fields out of the box.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

macOS, chrome

react-table version

v8.5.11

TypeScript version

4.7.4

Additional context

If reproducible example is needed let me know.

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