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 = ({
42
42
43
43
const canSubmit = revokeField . value === t ( localizationKeys ( 'apiKeys.revokeConfirmation.confirmationText' ) ) ;
44
44
45
+ const handleClose = ( ) => {
46
+ onClose ( ) ;
47
+ revokeField . setValue ( '' ) ;
48
+ } ;
49
+
45
50
const handleSubmit = async ( e : React . FormEvent ) => {
46
51
e . preventDefault ( ) ;
47
52
if ( ! apiKeyId || ! canSubmit ) return ;
@@ -50,7 +55,7 @@ export const RevokeAPIKeyConfirmationModal = ({
50
55
const cacheKey = { key : 'api-keys' , subject } ;
51
56
52
57
void mutate ( cacheKey ) ;
53
- onClose ( ) ;
58
+ handleClose ( ) ;
54
59
} ;
55
60
56
61
if ( ! isOpen ) {
@@ -60,7 +65,7 @@ export const RevokeAPIKeyConfirmationModal = ({
60
65
return (
61
66
< Modal
62
67
handleOpen = { onOpen }
63
- handleClose = { onClose }
68
+ handleClose = { handleClose }
64
69
canCloseModal = { false }
65
70
portalRoot = { modalRoot }
66
71
containerSx = { [
@@ -107,7 +112,7 @@ export const RevokeAPIKeyConfirmationModal = ({
107
112
submitLabel = { localizationKeys ( 'apiKeys.revokeConfirmation.formButtonPrimary__revoke' ) }
108
113
colorScheme = 'danger'
109
114
isDisabled = { ! canSubmit }
110
- onReset = { onClose }
115
+ onReset = { handleClose }
111
116
elementDescriptor = { descriptors . apiKeysRevokeModalSubmitButton }
112
117
/>
113
118
</ Form . Root >
You can’t perform that action at this time.
0 commit comments