Skip to content

Commit

Permalink
fix(clerk-js): Prevent submitting on enter in Organization Profile fo…
Browse files Browse the repository at this point in the history
…rm (#2400)

* fix(clerk-js): Prevent submitting on enter in Organization Profile form

* fix(clerk-js): Prevent submitting on enter in Organization Profile form
  • Loading branch information
panteliselef authored Dec 19, 2023
1 parent cfea3d9 commit 394cecc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hot-ducks-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Prevent submitting on enter in Organization Profile form when submit button is disabled.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => {

const onSubmit = async (e: React.FormEvent) => {
e.preventDefault();
return (dataChanged ? organization.update({ name: nameField.value, slug: slugField.value }) : Promise.resolve())
return (canSubmit ? organization.update({ name: nameField.value, slug: slugField.value }) : Promise.resolve())
.then(onSuccess)
.catch(err => {
handleError(err, [nameField, slugField], card.setError);
Expand Down

0 comments on commit 394cecc

Please sign in to comment.