Skip to content

Conversation

@STRML
Copy link
Collaborator

@STRML STRML commented Dec 31, 2025

Summary

  • Use getBoundingClientRect() as fallback for SVG elements which lack clientWidth/clientHeight properties
  • Calculate SVG element offsets using bounding rectangles since they don't have offsetLeft/offsetTop
  • Accept Element (not just HTMLElement) for bounds container to support SVG parent elements
  • HTMLElements still use the fast path (clientWidth/clientHeight)
  • Add coverage/ to .gitignore

Fixes #213
Closes #594

Test plan

  • All existing tests pass
  • Lint passes
  • Microbenchmark confirms clientWidth is used for HTMLElements (no perf regression)

- Use getBoundingClientRect() as fallback for SVG elements which lack
  clientWidth/clientHeight properties
- Calculate SVG element offsets using bounding rectangles since they
  don't have offsetLeft/offsetTop
- Accept Element (not just HTMLElement) for bounds container to support
  SVG parent elements
- HTMLElements still use the fast path (clientWidth/clientHeight)

Fixes #213
Closes #594
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.

bound='parent' option in flex box

2 participants