diff --git a/.changeset/hot-ducks-wink.md b/.changeset/hot-ducks-wink.md new file mode 100644 index 00000000000..c1326c1859b --- /dev/null +++ b/.changeset/hot-ducks-wink.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Prevent submitting on enter in Organization Profile form when submit button is disabled. diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx index ed7e6de8b5f..c5a94b9a11e 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx @@ -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);