Repository navigation
fix(editor): don't snap dragged frames to their children's old positions - #12166
Open
SwastikTripathi wants to merge 1 commit into
Open
SwastikTripathi wants to merge 1 commit into
SwastikTripathi wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Author
|
Friendly ping, is there anything you'd like me to change in this PR? Happy to adjust. |
When dragging a frame, only the frame itself was excluded from the snap reference elements, but its children move along with it. The children stayed in the reference set at their pre-drag positions, so the frame snapped to "ghost" edges and points. Exclude frame children when caching reference points and gaps for a drag. Fixes excalidraw#10480 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SwastikTripathi
force-pushed
the
fix/frame-drag-ghost-snap
branch
from
October 11, 2026 02:37
5484c32 to
f336fac
Compare
Author
|
Rebased onto |
This branch was successfully deployed
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 #10480.
When you drag a frame, snapping excluded only the selected elements from the reference set. The frame's children move with it (
dragSelectedElementshandles them), but they stayed in the snap cache at their pre-drag positions. So the frame snapped to "ghost" edges and points where its children used to be, as in the issue's video.The drag handler now caches reference points and visible gaps with
includeElementsInFrames: true, so frame children are left out while their frame is being dragged. I made the change only in the drag path: resizing a frame doesn't move its children, so they're still valid snap targets there.Tests: I added
tests/snapping.test.tsx:master: the frame snaps to(50, 50)with 2 snap lines.yarn test:typecheckand the fullvitestsuite (138 files) pass.