Skip to content

fix(popover): Positioning in sticky containers#2256

Open
rkaraivanov wants to merge 1 commit into
masterfrom
rkaraivanov/fix-2255
Open

fix(popover): Positioning in sticky containers#2256
rkaraivanov wants to merge 1 commit into
masterfrom
rkaraivanov/fix-2255

Conversation

@rkaraivanov

Copy link
Copy Markdown
Member

Description

Switch to a fixed positioning strategy in sticky context to prevent lag/jitter during
repositioning.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Related Issues

Closes #2255

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 (absolute vs fixed) when opening.
  • Applies the resolved strategy to computePosition() and the popover container’s inline position style.
  • Adds unit tests asserting the chosen strategy for sticky vs non-sticky ancestor setups; removes the hard-coded position: absolute from :popover-open styles.

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.

@rkaraivanov rkaraivanov requested a review from simeonoff June 17, 2026 11:17

@simeonoff simeonoff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess this is just a temporary fix until we switch to anchor positioning?

@rkaraivanov

Copy link
Copy Markdown
Member Author

@simeonoff

It is but, in the end, it is really jarring in sticky context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: igc-select: dropdown jumps/flickers during page scroll when placed in a sticky container

4 participants