diff --git a/.changeset/thick-doors-smile.md b/.changeset/thick-doors-smile.md new file mode 100644 index 00000000000..df5423549e4 --- /dev/null +++ b/.changeset/thick-doors-smile.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Bug fix: Clear feedback of input field if `setError` is called with undefined. diff --git a/packages/clerk-js/src/ui/utils/useFormControl.ts b/packages/clerk-js/src/ui/utils/useFormControl.ts index 8e043f77be8..bf3f40e9652 100644 --- a/packages/clerk-js/src/ui/utils/useFormControl.ts +++ b/packages/clerk-js/src/ui/utils/useFormControl.ts @@ -106,6 +106,8 @@ export const useFormControl = ( const setError: FormControlState['setError'] = error => { if (error) { setFeedback({ message: translateError(error), type: 'error' }); + } else { + clearFeedback(); } }; const setSuccess: FormControlState['setSuccess'] = message => {