fix(dropdown): flip-up menu collapses off-screen (follow-up to #59)#60
Merged
Conversation
The flip-up branch cleared inline `top` to "", which let the menu's `top-[105%]` utility class reassert top:105% on the now-fixed element — collapsing the menu to a 2px sliver below the viewport, so toggles near the viewport bottom appeared not to open. Set the unused anchor to "auto" so the inline value wins over the class. Add an e2e regression for the flip-up path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Staging deployment: https://timetracker-staging-fix-issue-39-dropdown-clipped.fly.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #59, which fixed the dropdown clipping but introduced a flip-up regression.
Problem
When a dropdown toggle sits near the viewport bottom, the menu must flip up. In that branch the code cleared inline
topwith""— which let the menu'stop-[105%]utility class reasserttop: 105%on the now-position:fixedelement. Withbottomalso set, the box collapsed to a 2px sliver below the viewport, so toggles near the bottom appeared not to open at all.The open-down path worked only because it sets inline
topexplicitly, overriding the class. The original e2e only exercised open-down, so this slipped through.Measured before (viewport 760, bottom rows): menu
top:798 bottom:800 height:2.Fix
Set the unused anchor to
"auto"instead of""so the inline value wins over thetop-[105%]class:After fix: flip-up rows open upward, fully on-screen (heights 407–542px).
Tests
Added
test_device_dropdown_flips_up_near_viewport_bottom(scrolls so lower rows sit near the viewport bottom, asserts the menu is a real on-screen box, not a sliver).make checkgreen (536 tests).🤖 Generated with Claude Code