Repository navigation
Read sortable-item size from layout pixels, not the transformed rect - #698
Merged
NullVoxPopuli merged 1 commit intoNov 17, 2026
Conversation
getBoundingClientRect() is scaled by a CSS transform on an ancestor, but offsetTop, offsetLeft and margins are not, so the width and height getters mixed scaled and unscaled values. Read the fractional size from the computed style instead, with an offset-size fallback. Fixes adopted-ember-addons#697 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
👷 Deploy request for ember-sortable pending review.Visit the deploys page to approve it
|
NullVoxPopuli
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #697
What
sortable-item'swidthandheightgetters readgetBoundingClientRect()(since 5.4.0). That rect is scaled by a CSStransformon an ancestor, whileoffsetTop,offsetLeftand the margins are not, so the drag math mixes scaled and unscaled values.The getters now read the fractional border-box size from the computed style through a new
getLayoutSizehelper. It adds padding and border whenbox-sizingiscontent-box, and falls back tooffsetWidth/offsetHeightwhen the computed size is not a number (for exampleauto).This keeps fractional precision without the transform scaling.
Why the tests didn't catch it
The new test renders the list under
transform: scale(0.5)with fractional item sizes and checksheightandwidthagainst the layout size. The default ember-qunit container is scaled by 0.5 too, which is where downstream apps hit this.Verification
masterand passes with the change.pnpm lintpasses.test-appsuite is not green in my environment either way: the same 16 acceptance tests hit the 60s timeout onmasterand with this change. Some of them pass when run on their own. I could not tell whether that is my environment or the suite, so CI is the real check.ember-sortable/test-support.Drafted with Claude Code (Claude Sonnet 5.5). The verification numbers come from local runs.