Skip to content

fix: Fix dropdown panel hidden behind sibling trigger buttons#901

Merged
dzbo merged 3 commits into
mainfrom
fix/dropdown-stacking-context-DEV-16284
May 28, 2026
Merged

fix: Fix dropdown panel hidden behind sibling trigger buttons#901
dzbo merged 3 commits into
mainfrom
fix/dropdown-stacking-context-DEV-16284

Conversation

@dzbo
Copy link
Copy Markdown
Collaborator

@dzbo dzbo commented May 28, 2026

Ticket ID

DEV-16284

Description

  • Add position: relative; height: 0 to :host — creates a stacking context so the z-50 dropdown panel floats above sibling trigger buttons; height: 0 makes :host a zero-height containing block so transform-based positioning anchors correctly
  • Replace hardcoded bottom-7/bottom-12 Tailwind classes (fixed pixel offsets that broke with PR feat: Replace openTop/isRight booleans with position prop on dropdown #898's auto-detection) with translateY(calc(-100% - triggerHeight - gap)) inline style — works for any trigger size; falls back to previousElementSibling when no trigger-id is provided (e.g. lukso-time-picker)
  • Fix auto position detection: replace viewport midpoint check with available-space comparison (boundary.bottom - rect.bottom < rect.top - boundary.top)
  • Add _findScrollContainer to detect the nearest non-full-page scroll container and use its bounds for flip detection — fixes AutoPositionScroll story and cases where the dropdown is inside a constrained scroll area; includes overflow, overflowX, and overflowY detection
  • Add StackingContext Storybook story with two vertically-stacked trigger+dropdown rows to reproduce and verify the sibling overlap fix

Copilot AI review requested due to automatic review settings May 28, 2026 12:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a visual layering issue where the lukso-dropdown panel could render behind adjacent (sibling) trigger buttons by making the dropdown host a positioned element, and adds a Storybook reproduction to verify the behavior.

Changes:

  • Update lukso-dropdown host styles to include position: relative so the component participates correctly in stacking/paint order relative to sibling buttons.
  • Add a StackingContext Storybook story with two vertically stacked trigger+dropdown rows to reproduce and validate the fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/components/lukso-dropdown/style.css Makes the dropdown host positioned to prevent the panel being painted under sibling triggers.
src/components/lukso-dropdown/lukso-dropdown.stories.ts Adds a dedicated Storybook scenario to reproduce and confirm correct overlay behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 28, 2026

Storybook deployed with Cloudflare Pages ☁️ 📖 🚀

Storybook

Built from commit 12cb510

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

Comment thread src/components/lukso-dropdown/style.css
Comment thread src/components/lukso-dropdown/style.css
Comment thread src/components/lukso-dropdown/index.ts Outdated
Comment thread src/components/lukso-dropdown/index.ts Outdated
Comment thread src/components/lukso-dropdown/index.ts Outdated
Comment thread src/components/lukso-dropdown/index.ts
…rigger-id; add overflowX to scroll container detection
@dzbo dzbo merged commit 0d7c759 into main May 28, 2026
8 checks passed
@dzbo dzbo deleted the fix/dropdown-stacking-context-DEV-16284 branch May 28, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants