input-number icon indicating copy to clipboard operation
input-number copied to clipboard

Parser should allow to return null instead of a number

Open Mathieuu opened this issue 4 years ago • 2 comments

Typescript should allow the parser function to return null or undefined. Sometimes, we want to leave a number field empty and not default to 0.

See the example below:

https://codesandbox.io/s/inputnumber-antd-14150-forked-higgh?file=/index.tsx

Sidenote: <InputNumber<number | undefined> does not work because T extends valueTypes which is number | string

Mathieuu avatar Apr 09 '21 18:04 Mathieuu

add @ts-ignore to the parser function 😂 acturally onChange will return null instead undefined even if your parser function return undefined

hugo1o1 avatar Jul 29 '21 11:07 hugo1o1