Skip to content

fix(core): accept SVG elements as scrollTo targets - #557

Merged
clementroche merged 1 commit into
mainfrom
fix/svg-scroll-targets-v1
Oct 15, 2026
Merged

clementroche merged 1 commit into
mainfrom
fix/svg-scroll-targets-v1

Conversation

@clementroche

Copy link
Copy Markdown
Member

scrollTo() only treated HTMLElement as an element target, so passing an SVG element did nothing (no warning, no scroll). TypeScript also rejected it at the call site. Selectors pointing at SVG already worked.

Accept any Element. getBoundingClientRect() and getComputedStyle() work the same on SVG, so the existing position math applies unchanged. README updated.

1.3.x counterpart of #556 (which fixes the v2 variant, where SVG targets jumped to the top).

Refs #551

🤖 Generated with Claude Code

scrollTo() only treated HTMLElement as an element target, so an SVG
element was silently ignored. Accept any Element; getBoundingClientRect()
and getComputedStyle() work the same on SVG.

Refs #551

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@clementroche
clementroche requested a review from a team as a code owner October 15, 2026 15:23
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
lenis-playground Ready Ready Preview Oct 15, 2026 3:23pm UTC

@clementroche
clementroche merged commit 1f60fb9 into main Oct 15, 2026
6 checks passed
@clementroche clementroche mentioned this pull request Oct 15, 2026

This branch was successfully deployed

1 active deployment
Preview — ef84677a Deployed Oct 15, 2026 by vercel[bot]
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.

1 participant