File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
packages/clerk-js/src/ui/components/ApiKeys Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @clerk/clerk-js " : patch
3+ ---
4+
5+ Clear API keys revoke confirmation field on modal close
Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ export const RevokeAPIKeyConfirmationModal = ({
4242
4343 const canSubmit = revokeField . value === t ( localizationKeys ( 'apiKeys.revokeConfirmation.confirmationText' ) ) ;
4444
45+ const handleClose = ( ) => {
46+ onClose ( ) ;
47+ revokeField . setValue ( '' ) ;
48+ } ;
49+
4550 const handleSubmit = async ( e : React . FormEvent ) => {
4651 e . preventDefault ( ) ;
4752 if ( ! apiKeyId || ! canSubmit ) return ;
@@ -50,7 +55,7 @@ export const RevokeAPIKeyConfirmationModal = ({
5055 const cacheKey = { key : 'api-keys' , subject } ;
5156
5257 void mutate ( cacheKey ) ;
53- onClose ( ) ;
58+ handleClose ( ) ;
5459 } ;
5560
5661 if ( ! isOpen ) {
@@ -60,7 +65,7 @@ export const RevokeAPIKeyConfirmationModal = ({
6065 return (
6166 < Modal
6267 handleOpen = { onOpen }
63- handleClose = { onClose }
68+ handleClose = { handleClose }
6469 canCloseModal = { false }
6570 portalRoot = { modalRoot }
6671 containerSx = { [
@@ -107,7 +112,7 @@ export const RevokeAPIKeyConfirmationModal = ({
107112 submitLabel = { localizationKeys ( 'apiKeys.revokeConfirmation.formButtonPrimary__revoke' ) }
108113 colorScheme = 'danger'
109114 isDisabled = { ! canSubmit }
110- onReset = { onClose }
115+ onReset = { handleClose }
111116 elementDescriptor = { descriptors . apiKeysRevokeModalSubmitButton }
112117 />
113118 </ Form . Root >
You can’t perform that action at this time.
0 commit comments