-
Current BehaviorBoth Dialog and Dropdown Item immediately close when I click on the Dropdown button. Expected BehaviorDropdown close, Dialog show up. Steps To Reproduce<DropdownMenu.Item>
<Dialog.Root>
<Dialog.Trigger
class={cn(
buttonVariants({ variant: 'destructive' }),
'w-full'
)}
>
<Trash class="mr-2 h-4 w-4" />
Delete meme
</Dialog.Trigger>
<Dialog.Content>
<Dialog.Header>
<Dialog.Title>Delete meme</Dialog.Title>
<Dialog.Description>
Are you sure you want to delete this template?
</Dialog.Description>
</Dialog.Header>
<Dialog.Footer>
<form
method="POST"
use:enhance
action="/{username}/{newId}/?/delete"
>
<Button type="submit" variant="destructive">
<Trash class="mr-2 h-4 w-4" />
Delete meme
</Button>
</form>
</Dialog.Footer>
</Dialog.Content>
</Dialog.Root>
</DropdownMenu.Item> Link to Reproduction / StackblitzNo response More InformationNo response |
Beta Was this translation helpful? Give feedback.
Answered by
CreedDE
Sep 9, 2023
Replies: 1 comment 5 replies
-
That's because your dialog is placed inside of the dropdown menu content which closes when you open the dialog. Place the dialog content outside of the dropdown menu content and you'll be good to go. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
He means that your
Dialog.Content
Component has to be outside theDropdownMenu.Content
component.That is my current
data-table-actions.svelte
file from the example Data Table.