fix: prevent dialog from closing on outside click and escape key
All checks were successful
Frontend CI / build (push) Successful in 1m37s
PR Title Check / pr-title-check (pull_request) Successful in 17s

This commit is contained in:
SquidSpirit 2025-10-14 02:21:03 +08:00
parent f367b56633
commit 8b1273a819

View File

@ -48,7 +48,11 @@
<Dialog {open} onOpenChange={(val) => (open = val)}>
<DialogTrigger class={buttonVariants({ variant: 'default' })}>Upload</DialogTrigger>
<DialogContent showCloseButton={false}>
<DialogContent
showCloseButton={false}
onInteractOutside={(e) => e.preventDefault()}
onEscapeKeydown={(e) => e.preventDefault()}
>
<DialogHeader class="mb-4">
<DialogTitle>Upload Image</DialogTitle>
</DialogHeader>