Skip to content

Conversation

@johanrd
Copy link
Contributor

@johanrd johanrd commented Nov 28, 2025

Summary

Fixes an issue where occluded-content height could be inflated by inherited line-height when used inside tables, causing visual jumps during scrolling.

Problem

When using VerticalCollection inside a <table>:

  • The occluded-content element renders as display: table-row
  • It contains debug text like "And 5 items before"
  • If the page has a line-height set (e.g., from Tailwind or global styles), this text creates a line box
  • The actual rendered height (getBoundingClientRect().height) becomes larger than the inline style="height: 44px"
  • VerticalCollection measures this inflated height and "corrects" its estimate upward
  • This causes rows to visually jump (e.g., 44px → 96.5px) when they first appear
Screenshot 2025-11-28 at 14 16 06

Solution

Add font-size: 0 and line-height: 0 to .occluded-content CSS, ensuring the debug text cannot affect layout height.

Test plan

  • Added test verifying line-height: 0 is set on occluded-content
  • Added test verifying actual height matches style height in tables
  • Verified test fails without fix, passes with fix

Before fix:
not ok 1 - occluded-content should have line-height: 0
expected: 0px
actual: 20px

After fix:
ok 1 - occluded-content should have line-height: 0

  When occluded-content is rendered inside a table (display: table-row),
  the debug text ("And X items before/after") can create a line box that
  inflates the element's actual height above its inline style height.
  This causes VerticalCollection to measure the wrong height and adjust
  its estimates, leading to visual jumps when scrolling.

  Add font-size: 0 and line-height: 0 to prevent the text from affecting
  layout while keeping it available for screen readers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant