return seed

This commit is contained in:
Qing
2022-09-20 22:43:20 +08:00
parent 32854d40da
commit 3e4021ec0d
6 changed files with 62 additions and 26 deletions

View File

@@ -1,4 +1,9 @@
import React, { FormEvent, InputHTMLAttributes, useState } from 'react'
import React, {
FormEvent,
InputHTMLAttributes,
useEffect,
useState,
} from 'react'
import TextInput from './Input'
interface NumberInputProps extends InputHTMLAttributes<HTMLInputElement> {
@@ -12,6 +17,10 @@ const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(
const { value, allowFloat, onValue, ...itemProps } = props
const [innerValue, setInnerValue] = useState(value)
useEffect(() => {
setInnerValue(value)
}, [value])
const handleOnInput = (evt: FormEvent<HTMLInputElement>) => {
const target = evt.target as HTMLInputElement
let val = target.value