Prevent pasting decimals

This commit is contained in:
Valtteri Karesto
2022-06-22 12:16:36 +03:00
parent 37208ce97e
commit a2a6596cc5

View File

@@ -256,7 +256,14 @@ export const TxUI: FC<UIProps> = ({
type={isFee ? "number" : "text"}
value={value}
onChange={(e) => {
handleSetField(field, e.target.value);
if (isFee) {
const val = e.target.value
.replaceAll(".", "")
.replaceAll(",", "");
handleSetField(field, val);
} else {
handleSetField(field, e.target.value);
}
}}
onKeyPress={
isFee