Skip to content

fix: use target RTL coordinates for external drops - #3471

Merged
adumesny merged 1 commit into
gridstack:masterfrom
jjohnnystwsss:fix/3470-rtl-external-drop
Nov 23, 2026
Merged

adumesny merged 1 commit into
gridstack:masterfrom
jjohnnystwsss:fix/3470-rtl-external-drop

Conversation

@jjohnnystwsss

Copy link
Copy Markdown
Contributor

Description

External drags into an RTL grid use a physical left-edge offset, while internal RTL drags and the layout engine use a right-edge offset. This mirrors the placeholder and the saved drop position.

Measure the helper from the target grid's right edge for RTL, including its width. LTR keeps its existing left-edge offset. The helper's cursor offset and the engine's coordinate convention are unchanged.

Fixes #3470.

Added 13 browser cases checking placeholder bounds, final element bounds and saved x/y: sidebar drops with both parent directions and one-/two-column widgets, mixed-direction grid transfers, and internal-drag controls.

Verification:

  • Untouched master: 6 RTL cases fail and 7 controls pass in the pinned Chromium.
  • Published 14.1.1 reproduces the same 6 failures; 12.2.2 passes all 8 sidebar physical-position controls (that release still stores RTL x from the left).
  • Fixed: all 48 targeted cases pass across Chromium, Firefox and WebKit, including 3 existing cancellation cases per browser. Local Playwright configuration disables the unused web server and video; the fixtures use inline HTML and the built bundle.
  • yarn build:core and yarn test pass (468 core + 10 React tests, type checks and lint). Two existing React hook lint warnings remain.

Codex assisted with investigation, implementation and tests. The before/after browser results and visual comparison were checked locally.

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing (yarn test)
  • Extended the README / documentation, if necessary (no API or usage change)

Measure the helper from the target grid right edge for RTL, matching internal drag coordinates. Cover sidebar drops, mixed-direction transfers and internal-drag controls with real browser tests.

Co-authored-by: Codex <noreply@openai.com>
@adumesny
adumesny merged commit 58bf2b3 into gridstack:master Nov 23, 2026
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.

RTL drag-and-drop renders the drop placeholder and widget at mirrored X coordinates

2 participants