Skip to content

Commit 234cca3

Browse files
committed
refactor: Explicitly manage form submission via button onClick and prevent default Enter key form submission.
1 parent 4e935b8 commit 234cca3

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎components/companies/CompanyRegistrationForm.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,11 @@ export function CompanyRegistrationForm({ onSuccess, onError, initialData, compa
302302
</div>
303303

304304
<form
305-
onSubmit={handleSubmit}
306305
className="space-y-6"
307306
onKeyDown={(e) => {
308307
// Prevent Enter key from submitting the form unless on final step
309-
if (e.key === 'Enter' && currentStep !== totalSteps) {
308+
if (e.key === 'Enter') {
310309
e.preventDefault();
311-
console.log('Enter key pressed, but not on final step - preventing submission');
312310
}
313311
}}
314312
>
@@ -720,7 +718,8 @@ export function CompanyRegistrationForm({ onSuccess, onError, initialData, compa
720718
</Button>
721719
) : (
722720
<Button
723-
type="submit"
721+
type="button"
722+
onClick={handleSubmit}
724723
disabled={isSubmitting}
725724
className="ml-auto bg-gradient-to-r from-primary to-primary/80 hover:from-primary/90 hover:to-primary/70"
726725
>

0 commit comments

Comments
 (0)