Skip to content

Popover component adds unwanted spacing in table cells #3616

@JamesN-dev

Description

@JamesN-dev

Current Behavior

Extra bottom spacing appears around popover triggers in table cells, creating layout gaps.

Image

Expected Behavior

Popover triggers in table cells should not add extra spacing beyond the intended content.

Link to Reproduction / Stackblitz

https://stackblitz.com/edit/sveltejs-kit-template-default-kxurdzqk?file=src%2Flib%2FDataTable.svelte

Environment Information

  • @skeletonlabs/skeleton: ^3.1.3
  • @skeletonlabs/skeleton-svelte: ^1.2.1
  • SvelteKit: ^2.16.0
  • Tailwind CSS: ^4.0.0

More Information

Root Cause:
The <span data-testid="popover"> wrapper and <button> trigger elements retain default spacing behavior that add unwanted padding/space.

Minimal Reproduction

<table class="table">
  <tr>
    <td>
      <Popover>
        {#snippet trigger()}
          <img src="image.jpg" class="w-16 h-16" />
        {/snippet}
        {#snippet content()}
          <div>Popover content</div>
        {/snippet}
      </Popover>
    </td>
  </tr>
</table>

Current Workaround:

.table span[data-testid='popover'] {
    display: block;
    line-height: 0;
}

.table button[data-part='trigger'] {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    line-height: 0;
    display: block;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationfeature requestRequest a feature or introduce and update to the project.

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions