Skip to content

Commit a51f4fc

Browse files
@W-19143871 Clear email footer validation messages upon keypress.
1 parent b97b2d5 commit a51f4fc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/template-retail-react-app/app/components/subscription/hooks/use-email-subscription.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ export const useEmailSubscription = ({tag} = {}) => {
125125
// Required by react-hook-form's Proxy-based formState.
126126
const {errors, isSubmitting} = form.formState
127127

128-
const onSubmit = form.handleSubmit(submitSubscription)
128+
const onSubmit = isFeatureEnabled
129+
? form.handleSubmit(submitSubscription)
130+
: (e) => {
131+
if (e?.preventDefault) e.preventDefault()
132+
}
129133

130134
return {form, onSubmit, successMessage, errors, isSubmitting}
131135
}

0 commit comments

Comments
 (0)