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 (#2200)
  • Loading branch information
panteliselef authored Nov 24, 2023
1 parent 2a7ef6d commit e214450
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 e214450

Please sign in to comment.