Prevent inputing decimals
This commit is contained in:
@@ -121,7 +121,7 @@ export const SetHookDialog: React.FC<{ accountAddress: string }> = React.memo(
|
|||||||
}
|
}
|
||||||
const res = await estimateFee(tx, account);
|
const res = await estimateFee(tx, account);
|
||||||
if (res && res.base_fee) {
|
if (res && res.base_fee) {
|
||||||
setValue("Fee", res.base_fee);
|
setValue("Fee", Math.round(Number(res.base_fee || "")).toString());
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
@@ -256,6 +256,12 @@ export const SetHookDialog: React.FC<{ accountAddress: string }> = React.memo(
|
|||||||
type="number"
|
type="number"
|
||||||
{...register("Fee", { required: true })}
|
{...register("Fee", { required: true })}
|
||||||
autoComplete={"off"}
|
autoComplete={"off"}
|
||||||
|
onKeyPress={(e) => {
|
||||||
|
if (e.key === "." || e.key === ",") {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
step="1"
|
||||||
defaultValue={10000}
|
defaultValue={10000}
|
||||||
css={{
|
css={{
|
||||||
"-moz-appearance": "textfield",
|
"-moz-appearance": "textfield",
|
||||||
@@ -295,7 +301,12 @@ export const SetHookDialog: React.FC<{ accountAddress: string }> = React.memo(
|
|||||||
const res = await estimateFee(tx, account);
|
const res = await estimateFee(tx, account);
|
||||||
|
|
||||||
if (res && res.base_fee) {
|
if (res && res.base_fee) {
|
||||||
setValue("Fee", res.base_fee);
|
setValue(
|
||||||
|
"Fee",
|
||||||
|
Math.round(
|
||||||
|
Number(res.base_fee || "")
|
||||||
|
).toString()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user