-
-
Notifications
You must be signed in to change notification settings - Fork 342
fix(virtual-core): prevent measurement jitter when scale is applied #986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 4cb29f8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
View your CI Pipeline Execution ↗ for commit 4cb29f8.
☁️ Nx Cloud last updated this comment at |
@usings Could you also update observeElementRect to use offsetWidth / offsetHeight as a fallback instead of getBoundingClientRect()? |
Sure. I’ll make that change shortly. |
…ional dimensions
Thanks @usings |
Problem
When using the
measureElement
function in combination with scaled elements (via CSStransform: scale(...)
), thegetBoundingClientRect()
method returns fractional values that may cause layout jitter or re-renders due to rounding inconsistencies.Solution
Fallback measurement now uses
offsetWidth
/offsetHeight
instead ofgetBoundingClientRect()
whenResizeObserverEntry.borderBoxSize
is not available. This avoids jitter caused by scaled bounding boxes.Why
offset*
?offsetWidth
/offsetHeight
give integer values.transform: scale(...)
, unlikegetBoundingClientRect()
.Impact
Improves measurement stability in virtualized lists using CSS transforms. No breaking changes.