Skip to content

Commit 20db787

Browse files
authored
Fix type definition of ValueType and InputNumber onChange (#482)
Resolves #481
1 parent be9a52f commit 20db787

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/InputNumber.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export interface InputNumberProps<T extends ValueType = ValueType>
7878
decimalSeparator?: string;
7979

8080
onInput?: (text: string) => void;
81-
onChange?: (value: T) => void;
81+
onChange?: (value: T | null) => void;
8282
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
8383

8484
onStep?: (value: T, info: { offset: ValueType; type: 'up' | 'down' }) => void;

‎src/utils/MiniDecimal.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { getNumberPrecision, isE, num2str, trimNumber, validateNumber } from './numberUtil';
44
import { supportBigInt } from './supportUtil';
55

6-
export type ValueType = string | number | null;
6+
export type ValueType = string | number;
77

88
export interface DecimalClass {
99
add: (value: ValueType) => DecimalClass;

0 commit comments

Comments
 (0)