Skip to content

Comments

[pull] main from motiondivision:main#209

Merged
pull[bot] merged 10 commits intocode:mainfrom
motiondivision:main
Feb 4, 2026
Merged

[pull] main from motiondivision:main#209
pull[bot] merged 10 commits intocode:mainfrom
motiondivision:main

Conversation

@pull
Copy link

@pull pull bot commented Feb 4, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

claude and others added 10 commits February 1, 2026 06:20
Root cause: Drag constraints are cached and only recalculated on drag start,
projection "measure" events, or window resize. When the draggable element
resizes via CSS, none of these triggers fire, leaving stale constraints
that cause overflow.

Fix: Attach ResizeObserver to the draggable element (and optionally the
constraint container) to trigger constraint recalculation on size changes.

https://claude.ai/code/session_013GYT7zpJ72FuvCdmttfsvU
…izes

This fixes an issue where drag constraints would not update when the
draggable element's dimensions changed (e.g., via CSS resize), causing
the element to overflow its constraint boundaries.

The fix adds ResizeObserver to both the draggable element and the
constraint container (when using ref-based constraints). When either
element resizes, the projection layout is updated and constraints are
recalculated.

Fixes #2458

https://claude.ai/code/session_013GYT7zpJ72FuvCdmttfsvU
…ment resize

Adds a test page and Cypress tests that reproduce the exact behavior from
issue #2458: a draggable element with ref-based constraints that gets
resized should have its constraints recalculated so it cannot overflow
the container.

Tests cover:
- Constraints work correctly before resize
- Constraints update after the draggable element is resized
- Constraints update after resize even with a prior drag offset

https://claude.ai/code/session_013GYT7zpJ72FuvCdmttfsvU
Ref-based drag constraints require a real layout engine to calculate
bounding boxes, which JSDOM doesn't provide. The Cypress E2E test
covers this behavior properly in a real browser.

https://claude.ai/code/session_013GYT7zpJ72FuvCdmttfsvU
Resolve issues with the initial ResizeObserver fix for #2458:
- Skip initial ResizeObserver callbacks (fires on observe()) to prevent
  corrupting element position on mount
- Reset constraints before recalculating in scalePositionWithinConstraints
  so the cached-constraint guard doesn't prevent fresh measurement
- Add render flush after repositioning to prevent visual flash
- Skip rebasing for ref-based constraints (already in correct coordinate space)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Each ResizeObserver fires on initial observation. Replace shared
counter with per-observer skipFirstCall wrapper so the skip logic
doesn't depend on knowing the total number of observed elements.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…-2458-YF8bb

Add resize observer support for ref-based drag constraints
@pull pull bot locked and limited conversation to collaborators Feb 4, 2026
@pull pull bot added the ⤵️ pull label Feb 4, 2026
@pull pull bot merged commit eae358f into code:main Feb 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants