Next.js Discord

Discord Forum

Alert Dialog instantly closes when triggered shadcn

Unanswered
Bully Kutta posted this in #help-forum
Open in Discord
Bully KuttaOP
sups lads

                  <AlertDialog>
                    <AlertDialogTrigger asChild>
                      <DropdownMenuItem className="text-red-500">
                        Delete
                      </DropdownMenuItem>
                    </AlertDialogTrigger>
                    <AlertDialogContent>
                      <AlertDialogHeader>
                        <AlertDialogTitle>
                          Are you absolutely sure?
                        </AlertDialogTitle>
                        <AlertDialogDescription>
                          This action cannot be undone. This will permanently
                          delete your account and remove your data from our
                          servers.
                        </AlertDialogDescription>
                      </AlertDialogHeader>
                      <AlertDialogFooter>
                        <AlertDialogCancel>Cancel</AlertDialogCancel>
                        <AlertDialogAction>Continue</AlertDialogAction>
                      </AlertDialogFooter>
                    </AlertDialogContent>
                  </AlertDialog>


so this is a shadcn dropdown menu and one of the items i need to trigger an alert dialog
it instantly closes for some reason
its not to do with anyt csss 10000%
idk wtf is going on

2 Replies

Bully KuttaOP
it opens but closes within a second
Bully KuttaOP
FIXED