return seed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user