mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Trade input accepts decimals with leading 0 (#1294)
* input accepts number with leading 0 decimals * input fields changes * value type fix Co-authored-by: ClaudiaHolhos <claudia@oceanprotocol.com>
This commit is contained in:
parent
9ebddd814d
commit
1256c20904
@ -29,7 +29,7 @@ export interface InputProps {
|
||||
options?: string[]
|
||||
sortOptions?: boolean
|
||||
additionalComponent?: ReactElement
|
||||
value?: string
|
||||
value?: string | number
|
||||
onChange?(
|
||||
e:
|
||||
| FormEvent<HTMLInputElement>
|
||||
|
@ -61,15 +61,16 @@ export default function TradeInput({
|
||||
placeholder="0"
|
||||
field={field}
|
||||
form={form}
|
||||
disabled={!accountId || disabled}
|
||||
additionalComponent={<Error meta={meta} />}
|
||||
value={`${field.value}`}
|
||||
{...field}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
||||
handleChange(e)
|
||||
handleValueChange(name, Number(e.target.value))
|
||||
// debounce needed to avoid validating the wrong (pass) value
|
||||
debounce(() => validateForm(), 100)
|
||||
}}
|
||||
disabled={!accountId || disabled}
|
||||
additionalComponent={<Error meta={meta} />}
|
||||
/>
|
||||
)}
|
||||
</Field>
|
||||
|
Loading…
Reference in New Issue
Block a user