Skip to content

fix(dropdown): stop table wrapper clipping the device dropdown (#39)#59

Merged
KucharczykL merged 1 commit into
mainfrom
fix/issue-39-dropdown-clipped
Jun 20, 2026
Merged

fix(dropdown): stop table wrapper clipping the device dropdown (#39)#59
KucharczykL merged 1 commit into
mainfrom
fix/issue-39-dropdown-clipped

Conversation

@KucharczykL

Copy link
Copy Markdown
Owner

Fixes #39.

Problem

The device (and game-status) dropdown menu is absolutely positioned inside the session list's .overflow-x-auto wrapper. overflow-x: auto forces overflow-y: auto, so when the menu is taller than a short table it gets clipped/cut off.

Measured before fix (1 row, 15 devices, 1280×800): menu position:absolute, bottom 528px below the wrapper's clip edge → cut off.

Fix

In initDropdown (ts/elements/dropdown.ts, shared by device + status selectors), open the menu with position: fixed anchored to its toggle so it escapes the clipping ancestor:

  • fixed top/left from the toggle's getBoundingClientRect(), width matched to the toggle.
  • Bounded to the viewport via max-height + internal overflow-y: auto.
  • Flips up when there's more room above than below.
  • Repositions on scroll (capture phase, to catch the table wrapper) and resize while open; inline styles cleared on close.

After fix: menu position:fixed, max-height:479px, fully within the viewport.

Tests

e2e/test_dropdown_clipping_e2e.py: opens the dropdown on a short table with a tall device list, asserts the menu is fixed and within the viewport, and selects a previously-clipped option (Device 14) successfully. make check green (535 tests).

🤖 Generated with Claude Code

The device/status dropdown menu is absolutely positioned inside the session
list's overflow-x-auto wrapper. Because overflow-x:auto forces overflow-y:auto,
a menu taller than a short table was clipped (issue #39). Open the menu with
position:fixed anchored to its toggle so it escapes the clipping ancestor,
bound it to the viewport with an internal scroll, flip it up when there is more
room above, and reposition on scroll/resize while open.

Fixes #39.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

@KucharczykL KucharczykL merged commit 4c1d7a9 into main Jun 20, 2026
4 checks passed
@KucharczykL KucharczykL deleted the fix/issue-39-dropdown-clipped branch June 20, 2026 21:16
@KucharczykL KucharczykL restored the fix/issue-39-dropdown-clipped branch June 20, 2026 21:18
KucharczykL added a commit that referenced this pull request Jun 20, 2026
fix(dropdown): flip-up menu collapses off-screen (follow-up to #59)
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.

Dropdown gets cut off

1 participant