From c1cfe162a6778631080dc77e552bd99468d5e265 Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Thu, 21 Aug 2025 11:32:47 -0700 Subject: [PATCH 1/3] chore(clerk-js): Clear API keys revoke confirmation field on modal close --- .../components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx b/packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx index c77e8fc37f3..794e15e53ea 100644 --- a/packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx +++ b/packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx @@ -53,6 +53,11 @@ export const RevokeAPIKeyConfirmationModal = ({ onClose(); }; + const handleClose = () => { + onClose(); + revokeField.setValue(''); + }; + if (!isOpen) { return null; } @@ -60,7 +65,7 @@ export const RevokeAPIKeyConfirmationModal = ({ return ( From 22ebf67b8109062b364e6af85fb57dc28498918d Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Thu, 21 Aug 2025 11:38:33 -0700 Subject: [PATCH 2/3] chore: clear field on submit --- .../ApiKeys/RevokeAPIKeyConfirmationModal.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx b/packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx index 794e15e53ea..2b51bd874f8 100644 --- a/packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx +++ b/packages/clerk-js/src/ui/components/ApiKeys/RevokeAPIKeyConfirmationModal.tsx @@ -42,6 +42,11 @@ export const RevokeAPIKeyConfirmationModal = ({ const canSubmit = revokeField.value === t(localizationKeys('apiKeys.revokeConfirmation.confirmationText')); + const handleClose = () => { + onClose(); + revokeField.setValue(''); + }; + const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!apiKeyId || !canSubmit) return; @@ -50,12 +55,7 @@ export const RevokeAPIKeyConfirmationModal = ({ const cacheKey = { key: 'api-keys', subject }; void mutate(cacheKey); - onClose(); - }; - - const handleClose = () => { - onClose(); - revokeField.setValue(''); + handleClose(); }; if (!isOpen) { From 12066a4f7e4162116812132c6f0d4d9234c9b4a3 Mon Sep 17 00:00:00 2001 From: Robert Soriano Date: Thu, 21 Aug 2025 11:40:01 -0700 Subject: [PATCH 3/3] chore: add changeset --- .changeset/cold-glasses-watch.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/cold-glasses-watch.md diff --git a/.changeset/cold-glasses-watch.md b/.changeset/cold-glasses-watch.md new file mode 100644 index 00000000000..9def8809de7 --- /dev/null +++ b/.changeset/cold-glasses-watch.md @@ -0,0 +1,5 @@ +--- +"@clerk/clerk-js": patch +--- + +Clear API keys revoke confirmation field on modal close