fix(popover): Positioning in sticky containers#2256
Open
rkaraivanov wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts igc-popover positioning to avoid scroll jitter when the anchor is inside a position: sticky container by switching Floating UI’s positioning strategy to fixed in that scenario.
Changes:
- Detects whether the anchor has a sticky ancestor (crossing shadow boundaries) and caches a resolved positioning strategy (
absolutevsfixed) when opening. - Applies the resolved strategy to
computePosition()and the popover container’s inlinepositionstyle. - Adds unit tests asserting the chosen strategy for sticky vs non-sticky ancestor setups; removes the hard-coded
position: absolutefrom:popover-openstyles.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/popover/themes/light/popover.base.scss | Removes the always-absolute :popover-open positioning so JS can apply absolute/fixed per scenario. |
| src/components/popover/popover.ts | Adds sticky-ancestor detection and switches Floating UI strategy + container position accordingly; refactors autoUpdate reset logic. |
| src/components/popover/popover.spec.ts | Updates selectors and adds coverage for fixed strategy when placed under sticky ancestors. |
simeonoff
approved these changes
Jun 17, 2026
simeonoff
left a comment
Collaborator
There was a problem hiding this comment.
I guess this is just a temporary fix until we switch to anchor positioning?
Member
Author
|
It is but, in the end, it is really jarring in sticky context. |
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.
Description
Switch to a fixed positioning strategy in sticky context to prevent lag/jitter during
repositioning.
Type of Change
Related Issues
Closes #2255
Checklist