Skip to content

Commit

Permalink
fix(clerk-js): Reset CodeControl when resetting wizard in VerifyDomai…
Browse files Browse the repository at this point in the history
…nPage
  • Loading branch information
panteliselef committed Nov 23, 2023
1 parent d941b90 commit b5828c7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-moose-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Reset OTP field when pressing "Cancel" in VerifyDomainPage inside `<OrganziatoinProfile/>`.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ export const VerifyDomainPage = withCardStateProvider(() => {
textVariant='buttonExtraSmallBold'
type='reset'
isDisabled={status.isLoading || success}
onClick={wizard.prevStep}
onClick={() => {
codeControlState.clearFeedback();
codeControl.reset();
wizard.prevStep();
}}
localizationKey={localizationKeys('userProfile.formButtonReset')}
/>
</FormButtonContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ export const VerifyDomainPage = withCardStateProvider(() => {
textVariant='buttonExtraSmallBold'
type='reset'
isDisabled={status.isLoading || success}
onClick={wizard.prevStep}
onClick={() => {
codeControlState.clearFeedback();
codeControl.reset();
wizard.prevStep();
}}
localizationKey={localizationKeys('userProfile.formButtonReset')}
/>
</FormButtonContainer>
Expand Down

0 comments on commit b5828c7

Please sign in to comment.