material-react-table icon indicating copy to clipboard operation
material-react-table copied to clipboard

ZERO IS NOT WORKING IN COLUMN FILTER IN NUMBER INPUT in manual filter

Open NarenderDhamarlapally opened this issue 1 year ago • 4 comments

material-react-table version

3.0.1

react & react-dom versions

18.0.0

Describe the bug and the steps to reproduce it

when i enter 0 in filter it is not updating in columnFilters it is a number type

please check the video

Minimal, Reproducible Example - (Optional, but Recommended)

https://codesandbox.io/p/sandbox/keen-meninsky-zt8r54

Screenshots or Videos (Optional)

https://github.com/user-attachments/assets/14cf0fec-1512-4244-8484-8f04bc2d6416

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

None

Terms

  • [X] I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

NarenderDhamarlapally avatar Oct 07 '24 10:10 NarenderDhamarlapally

I cannot reproduce this bug with v3.0.3. I think it was fixed by @KevinVandy in this release as stated in the changelog https://www.material-react-table.com/changelog#version-3.0.3---2024-12-13 and additionally by a release of tanstack-table/react (see https://github.com/TanStack/table/releases/tag/v8.20.5)

Could you please verify with newest version and close this issue if resolved.

fredericbahr avatar Dec 21 '24 17:12 fredericbahr

You sure you updated?

KevinVandy avatar Feb 15 '25 22:02 KevinVandy

I am having the same problem with a project. *I forked the project and updated the version, and it looks like it's still an issue, at least in the example. https://codesandbox.io/p/sandbox/sample-forked-8yc6w6 Image Do you have an example where using type: 'number' and trying to filter using 0 works?

Tejada-Joyce avatar Mar 19 '25 23:03 Tejada-Joyce

USE V2 VERSION IT IS WORKING

CODE IS MERGED IN V2

CODE IS NOT MERGED IN V3

V2 VERSION CODE

const handleTextFieldChange = (event: ChangeEvent<HTMLInputElement>) => { const newValue = textFieldProps.type === 'date' ? event.target.valueAsDate : textFieldProps.type === 'number' ? isNaN(event.target.valueAsNumber) ? undefined : event.target.value : event.target.value; handleChange(newValue); textFieldProps?.onChange?.(event); };

V3 VERSION CODE

const handleTextFieldChange = (event: ChangeEvent<HTMLInputElement>) => { const newValue = textFieldProps.type === 'date' ? event.target.valueAsDate : textFieldProps.type === 'number' ? event.target.valueAsNumber : event.target.value; handleChange(newValue); textFieldProps?.onChange?.(event); };

NarenderDhamarlapally avatar Mar 20 '25 13:03 NarenderDhamarlapally