Update MRT_FilterTextField.tsx#1260
Conversation
empty string as a number
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
if we convert to string to valueAsNumber then column.setfiltervalue is not taking direct 0 value
|
This pull request includes a small but important change to the
|
| ? event.target.valueAsDate | ||
| : textFieldProps.type === 'number' | ||
| ? event.target.valueAsNumber | ||
| ? isNaN(event.target.valueAsNumber) ? undefined : event.target.value |
There was a problem hiding this comment.
shouldn't this still return event.target.valueAsNumber when valid instead of just value?
There was a problem hiding this comment.
The columnFilters are not functioning as expected when the value is a numeric 0,
while they work correctly when the value is the text '0'.
please check the CSB and Video
There was a problem hiding this comment.
I am working in ERP application user will check > 0 , >=0, <0,<=0.
Zero is not working when number input it is working as text input.
I want to work with number input.
please check Once
https://github.com/user-attachments/assets/2c26f71d-1b8c-48e1-b0d5-6bc13749c9e6
empty string as a number,
type = "number"
muiFilterTextFieldProps: ({ column }) => {
return {
type: column?.columnDef?.meta?.type, // number
}
Warning: Received NaN for the
valueattribute. If this is expected, cast the value to a string.when manualfilter is true
Plese check the codesandbox