admin管理员组

文章数量:1291460

I have a problem when Modal appears and I click the trigger on the dropdown but it doesn't appear. Then I tried to change the dropdown to AlertDialog but it still works, please help me.

This is the intercepting route

export default function DetailModal() {
  const params = useParams<{ id: string }>();
  const router = useRouter();

  const { data, isLoading } = useGetDetailPost({ postId: params.id });

  return (
    <Dialog
      defaultOpen={true}
      onOpenChange={(open) => {
        if (!open) {
          router.back();
        }
      }}
    >
      <DialogContent className="bg-bw max-w-[50vw]">
        <DialogTitle>
          <VisuallyHidden />
        </DialogTitle>
        <LoadingState
          data={data?.data}
          loadingFallback={<SkeletonCard length={1} />}
        >
          <PostDetail post={data?.data} isLoading={isLoading} dbUserId="id" />
        </LoadingState>
      </DialogContent>
    </Dialog>
  );
}

This is a dropdown

 <DropdownMenu modal={false}>
        <DropdownMenuTrigger asChild>
          <MoreHorizontalIcon className="w-4 aspect-square cursor-pointer hover:text-gray-600" />
        </DropdownMenuTrigger>
        <DropdownMenuContent
          side="left"
          className="bg-bw z-[1000]"
          align="start"
        >
          <DropdownMenuItem
            className="cursor-pointer bg-bw"
            onClick={() => setOpenEditDialog(true)}
          >
            Edit Komen
          </DropdownMenuItem>
          <DropdownMenuItem
            onClick={() => setOpenDeleteDialog(true)}
            className="cursor-pointer focus:bg-destructive focus:text-bw bg-bw"
          >
            Hapus Komen
          </DropdownMenuItem>
        </DropdownMenuContent>
      </DropdownMenu>

本文标签: nextjsBug on Dropdown in Dialog in ShadcnUiStack Overflow