Skip to content

Conversation

@WTomoharu
Copy link

Fixes issue #213 by support for bound='parent' with SVG.
Closes: #213

@WTomoharu WTomoharu changed the title Fix: bounds with SVG Fix: bound='parent' with SVG Aug 20, 2021
@STRML
Copy link
Collaborator

STRML commented Dec 31, 2025

Closing this PR as stale. This PR fixing SVG bounds has been open since 2021 without being merged. If SVG bounds='parent' is still an issue, please open a fresh PR against the current codebase. Thank you for the contribution!

@STRML STRML closed this Dec 31, 2025
@STRML
Copy link
Collaborator

STRML commented Dec 31, 2025

Reopening - this is an important fix for SVG bounds support.

@STRML STRML reopened this Dec 31, 2025
STRML added a commit that referenced this pull request Dec 31, 2025
- 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
@STRML
Copy link
Collaborator

STRML commented Dec 31, 2025

Implemented in #789 with improvements: uses clientWidth/clientHeight for HTMLElements (fast path) and falls back to getBoundingClientRect only for SVG elements. Also fixed a bug in the original PR where paddingLeft was used for top offset calculation.

@STRML STRML closed this Dec 31, 2025
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