Skip to content

Commit 1965d1b

Browse files
committed
fix(webapp): Cancel button in API key regeneration dialog now closes the modal
The Cancel button was missing an onClick handler to close the modal dialog. This caused confusing behavior where clicking Cancel would not dismiss the dialog. Also added type="button" to prevent form submission since the button is inside a form. Slack thread: https://triggerdotdev.slack.com/archives/C04CR1HUWBV/p1768323370953509
1 parent bb25340 commit 1965d1b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/webapp/app/components/environments/RegenerateApiKeyModal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,11 @@ const RegenerateApiKeyModalContent = ({ id, randomWord, title, closeModal }: Mod
9494
Regenerate
9595
</Button>
9696
}
97-
cancelButton={<Button variant={"tertiary/medium"}>Cancel</Button>}
97+
cancelButton={
98+
<Button variant={"tertiary/medium"} type="button" onClick={closeModal}>
99+
Cancel
100+
</Button>
101+
}
98102
/>
99103
</Fieldset>
100104
</fetcher.Form>

0 commit comments

Comments
 (0)