Skip to content

fix(#3455,#3450): Updated top and bottom positioning for Popover#3477

Open
ArakTaiRoth wants to merge 1 commit intodevfrom
dustin/3455
Open

fix(#3455,#3450): Updated top and bottom positioning for Popover#3477
ArakTaiRoth wants to merge 1 commit intodevfrom
dustin/3455

Conversation

@ArakTaiRoth
Copy link
Collaborator

@ArakTaiRoth ArakTaiRoth commented Feb 20, 2026

Before (the change)

The two issues were Dropdown not expanding outside a Container, and AppHeaderMenu not expanding to max width when necessary.

After (the change)

Both the above issues should be resolved.

Check samples in

It works for dropdowns in Containers:

image

It also works for inside a modal:

image

Also the main navbar was updated. Other than the border, the navbar items push right up to the side of the screen but don't go past:

image

Make sure that you've checked the boxes below before you submit the PR

  • I have read and followed the setup steps
  • I have created necessary unit tests
  • I have tested the functionality in both React and Angular.

Steps needed to test

@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for goa-design-2 ready!

Name Link
🔨 Latest commit 52238a8
🔍 Latest deploy log https://app.netlify.com/projects/goa-design-2/deploys/699f73fef88e190008525e30
😎 Deploy Preview https://deploy-preview-3477--goa-design-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

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 fixes two issues with the Popover component: Dropdown not expanding outside Container (#3450) and AppHeaderMenu not expanding to max width (#3455). The fix changes the positioning strategy from using bottom CSS property with a position: relative wrapper to using top CSS property with absolute positioning relative to the offsetParent. This allows popovers to properly escape container boundaries with overflow properties.

Changes:

  • Updated Popover positioning logic to use top instead of bottom and calculate position relative to offsetParent
  • Removed position: relative style from popover wrapper div to allow proper absolute positioning
  • Updated test assertions to reflect new positioning approach (checking style.top instead of style.bottom)
  • Added test pages in both React and Angular to demonstrate the fix

Reviewed changes

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

Show a summary per file
File Description
libs/web-components/src/components/popover/Popover.svelte Core fix: calculates top position using offsetParent, removes relative positioning wrapper
libs/react-components/specs/popover.browser.spec.tsx Updates test assertions from bottom to top positioning, adds window dimension mocking
apps/prs/react/src/routes/bugs/bug3450.tsx New test page demonstrating Dropdown and DatePicker expanding outside Container
apps/prs/react/src/main.tsx Adds routing for bug3450 test page
apps/prs/react/src/app/app.tsx Adds AppHeaderMenu test items and navigation link
apps/prs/angular/src/routes/bugs/3450/bug3450.component.ts Angular component for bug3450 test page
apps/prs/angular/src/routes/bugs/3450/bug3450.component.html Angular template for bug3450 test page
apps/prs/angular/src/app/app.routes.ts Adds routing for Angular bug3450 test page
apps/prs/angular/src/app/app.component.html Adds AppHeaderMenu test items and navigation link (contains naming issue)

Super long menu item to test overflow handling lorem ipsum dolor sit amet
</a>
</goab-app-header-menu>
<goa-app-header-menu heading="John Smith" leadingIcon="person-circle">
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

Inconsistent component name: This line uses 'goa-app-header-menu' instead of 'goab-app-header-menu'. All other instances in this file use the 'goab-' prefix. This should be changed to 'goab-app-header-menu' to match the consistent naming convention used throughout the file.

Copilot uses AI. Check for mistakes.
_popoverEl.style.top = `${topPos}px`;
} else {
_popoverEl.style.bottom = "auto"; // In case this is triggered by _sectionHeight is changed
// Clear top/bottom to keep default below-target static positioning.
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The comment mentions "static positioning" but the popover-content element has position: absolute (see line 551 in the style section). Consider updating the comment to clarify that clearing these properties allows the element to use its default absolute positioning relative to its offsetParent, which places it below the target.

Suggested change
// Clear top/bottom to keep default below-target static positioning.
// Clear top/bottom so the popover uses its default absolute positioning
// relative to its offsetParent, which places it below the target.

Copilot uses AI. Check for mistakes.
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.

AppHeaderMenu is squished Dropdown expanding inside Container

3 participants