Prevent closing dialog when announcements are selected in AddAnnuncio component
This commit is contained in:
parent
63d2fbd8ad
commit
6124ba0271
1 changed files with 8 additions and 1 deletions
|
|
@ -121,7 +121,14 @@ export const AddAnnuncio = ({
|
|||
Annuncio
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="sm:max-w-[425px]">
|
||||
<DialogContent
|
||||
className="sm:max-w-[425px]"
|
||||
onInteractOutside={(e) => {
|
||||
if (selectedAnnunci.length !== 0) {
|
||||
e.preventDefault(); // Prevent closing the dialog if there are selected announcements
|
||||
}
|
||||
}}
|
||||
>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Aggiungi annuncio</DialogTitle>
|
||||
<DialogDescription>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue