Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
Stop payment submit event default propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
orzechdev committed Aug 24, 2020
1 parent ba1aea4 commit 2a1cd85
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,13 @@ const AdyenPaymentGateway: React.FC<IProps> = ({
}
}, [formRef, dropin]);

const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
processPayment();
};

return (
<form ref={formRef} onSubmit={processPayment}>
<form ref={formRef} onSubmit={handleSubmit}>
<div ref={gatewayRef} />
<ErrorMessage errors={errors} />
</form>
Expand Down

0 comments on commit 2a1cd85

Please sign in to comment.