nuxt / ui

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.
https://ui.nuxt.com
MIT License
3.79k stars 462 forks source link

UTable: Expand Slot causes EmptyState width issue #2055

Open rmbakker88 opened 1 month ago

rmbakker88 commented 1 month ago

Environment

Version

v2.18.4

Reproduction

https://stackblitz.com/edit/github-kntdwe?file=app.vue

Description

Initialize any UTable, make sure it is empty. Add an expand slot. The Empty State slot will now not span the full width of the table.

Remove the expand slot, and the Empty State is the full width of the table again.

Additional context

image

Logs

No response

DrxcoDev commented 1 month ago

This issue might be related to CSS or layout handling when expand slots are present. Review the CSS styles or layout calculations applied to the UTable component when expand slots are included. Ensure that the styles for the Empty State are applied correctly and consider adding a CSS rule to ensure it spans the full width regardless of other slots.

jscaltreto commented 4 weeks ago

I'm seeing this, too. When the expand slot is used, an extra <th> is added to the header, but the corresponding colspan for the loading and empty states is not increased by 1 as it is when modelValue is present. The result is that the colspan is one fewer than it should be to completely fill the table.