From 9fb0e7d0b386a1b10a39d0b664131590cd0c3a68 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Thu, 22 Dec 2022 18:38:21 -0300
Subject: prevent form submit

---
 packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

(limited to 'packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx')

diff --git a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
index 3f048c385..1922eeed3 100644
--- a/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
+++ b/packages/demobank-ui/src/pages/PaytoWireTransferForm.tsx
@@ -74,7 +74,13 @@ export function PaytoWireTransferForm({
   if (!pageState.isRawPayto)
     return (
       <div>
-        <form class="pure-form" name="wire-transfer-form">
+        <form
+          class="pure-form"
+          name="wire-transfer-form"
+          onSubmit={(e) => {
+            e.preventDefault();
+          }}
+        >
           <p>
             <label for="iban">{i18n.str`Receiver IBAN:`}</label>&nbsp;
             <input
@@ -155,11 +161,12 @@ export function PaytoWireTransferForm({
 
           <p style={{ display: "flex", justifyContent: "space-between" }}>
             <input
-              type="button"
+              type="submit"
               class="pure-button pure-button-primary"
               disabled={!!errorsWire}
               value="Send"
-              onClick={async () => {
+              onClick={async (e) => {
+                e.preventDefault();
                 if (
                   typeof submitData === "undefined" ||
                   typeof submitData.iban === "undefined" ||
@@ -203,7 +210,8 @@ export function PaytoWireTransferForm({
               type="button"
               class="pure-button"
               value="Clear"
-              onClick={async () => {
+              onClick={async (e) => {
+                e.preventDefault();
                 submitDataSetter((p) => ({
                   amount: undefined,
                   iban: undefined,
-- 
cgit v1.2.3

