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
|
Annuncio
|
||||||
</Button>
|
</Button>
|
||||||
</DialogTrigger>
|
</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>
|
<DialogHeader>
|
||||||
<DialogTitle>Aggiungi annuncio</DialogTitle>
|
<DialogTitle>Aggiungi annuncio</DialogTitle>
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue