diff --git a/src/components/primitives/Input.tsx b/src/components/primitives/Input.tsx index 6e1056ff7..fc4e4f35d 100644 --- a/src/components/primitives/Input.tsx +++ b/src/components/primitives/Input.tsx @@ -78,13 +78,14 @@ function Input({ look, size, state, className, ...props }: InputProps) { Input.BigInt = function InputBigInt({ state, base, ...props }: InputProps & { base: number }) { const [internal, setInternal] = useState(); - const [displayed, setDisplayed] = useState("0.0"); + const [displayed, setDisplayed] = useState(); const [_getter, setter] = state ?? []; const _value = useMemo(() => { const _value = !state ? internal : state?.[0]; const transformed = formatUnits(_value ?? 0n, base); + if (_value === undefined || _value === 0n) return displayed; return transformed ?? displayed; }, [internal, state, displayed, base]); @@ -92,7 +93,7 @@ Input.BigInt = function InputBigInt({ state, base, ...props }: InputProps { try { if (v === undefined) { - setter?.(0n) ?? setInternal(0n); + setter?.(v) ?? setInternal(v); return; }