Closed tsekiguchi closed 2 months ago
Button and Dropdown need to be in the same row.
I am having issues with dropdown placement in my table - on ios safari. I thought this was fixed in the dropdown updates that were done but its still acting up.
Video Recording: https://github.com/themesberg/flowbite-svelte/assets/57114335/a480f554-fb1f-4248-a081-708a97703e80
Code used (simplified):
<Table class='min-w-[920px] md:min-w-[1100px]'>
<TableHead>
<TableHeadCell class={thClass}>action</TableHeadCell>
</TableHead>
<TableBody>
{#each orders as order, index (order.id)}
<TableBodyRow>
<TableBodyCell {tdClass}>
<Button
color="none"
size="xs"
class="dropdown-actions rounded-none"
on:click={() => setActiveOrder(order, index)}
>
<Icon src={EllipsisVertical} class="w-5" />
</Button>
</TableBodyCell>
</TableBodyRow>
{/each}
</TableBody>
</Table>
<Dropdown
bind:open={dropdownOpen}
placement="bottom-end"
triggeredBy={'.dropdown-actions'}
containerClass="z-10 w-36"
>
<DropdownItem on:click={() => onOpenResend()} class="flex gap-3 items-center">
<Icon src={ArrowPath} size="15" />
Resend
</DropdownItem>
<DropdownItem class="flex gap-3 items-center" href={activeOrder?.attributes?.pdf_url} download target="_blank">
<Icon src={ArrowDownTray} size="15" />
Download
</DropdownItem>
</Dropdown>
I will close the issue for now. Please feel free to open a new issue.
Describe the bug
When using the table components that are provided, if a button with a dropdown menu is put inside, the dropdown functions but options are cut off by the bounds of the table, and positioning is not respected. However, when testing with HTML Table elements, dropdown menus work fine.
Reproduction
Here's a quick test mockup using Table Elements, Button, and Dropdown
https://stackblitz.com/edit/sveltejs-kit-template-default-4rfsg8?file=src%2Froutes%2F%2Bpage.svelte
Flowbite version and System Info