Skip to content

Commit

Permalink
fix(stepper): 修复 input 事件对象类型推断
Browse files Browse the repository at this point in the history
  • Loading branch information
taninsist authored and raylotan committed Sep 18, 2024
1 parent 4b001d9 commit d13d1e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stepper/Stepper.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, memo } from 'react';
import React, { FormEvent, forwardRef, memo } from 'react';
import classNames from 'classnames';
import { AddIcon, RemoveIcon } from 'tdesign-icons-react';
import useDefaultProps from 'tdesign-mobile-react/hooks/useDefaultProps';
Expand Down Expand Up @@ -89,8 +89,8 @@ const Stepper = forwardRef<HTMLDivElement, StepperProps>((originProps, ref) => {
updateValue(formatValue(add(Number(currentValue), -step)));
};

const handleInput = (e: Event) => {
const value = formatNumber((e.target as HTMLTextAreaElement).value, !integer);
const handleInput = (e: FormEvent<HTMLInputElement>) => {
const value = formatNumber((e.target as HTMLInputElement).value, !integer);
setCurrentValue(value);
};

Expand Down

0 comments on commit d13d1e6

Please sign in to comment.