Skip to content

fix(subheader): prevent scroll jump when opening igc-select#83

Open
dobromirts wants to merge 1 commit into
masterfrom
dtsvetkov/prevent-scroll-jump-igc-select
Open

fix(subheader): prevent scroll jump when opening igc-select#83
dobromirts wants to merge 1 commit into
masterfrom
dtsvetkov/prevent-scroll-jump-igc-select

Conversation

@dobromirts

@dobromirts dobromirts commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Closes #81

Clicking the package/version igc-select in the sticky subheader while scrolled down caused the page to jump.

  1. AbortController - adds a disconnectedCallback and aborts all listeners on each connectedCallback, preventing listener accumulation on Astro View Transition page navigations (root cause of the regression)
  2. igcInput.focus patch -permanently patches igc-input.focus() inside igc-select's shadow to always pass preventScroll: true, eliminating the scroll on programmatic focus calls (_selectItem, _handleEscape, etc.) that fire on item selection / close
  3. scroll-behavior: auto guard - DocsLayout sets scroll-behavior: smooth on , causing the browser's click-triggered focus scroll to animate over multiple frames. Forcing auto on pointerdown and restoring after focusin makes the scroll instant so the savedY correction fires in the same frame with no visible flicker

@dobromirts dobromirts added the ❌ status: awaiting-test PRs awaiting manual verification label Jun 16, 2026
@ChronosSF ChronosSF requested a review from rkaraivanov June 16, 2026 15:49
@rkaraivanov

rkaraivanov commented Jun 16, 2026

Copy link
Copy Markdown
Member

@dobromirts

Regarding point 2, that should be logged as an issue in the select component itself and fixed there IMO.

Also, since we depend on igniteui-webcomponents, can we use Lit to encapsulate all the vanilla JS stuff around some of the astro components into a bunch of custom elements (that is no Shadow DOM), just to make easier to template, bind and keep up state more structured.

Feel free to ping me for additional discussion.

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

Labels

❌ status: awaiting-test PRs awaiting manual verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subheader igc-select triggers scrollIntoView on focus causing flickering and page jumping

3 participants