Skip to content

feat(core): pointerdrag.js pointer-events based drag toolkit#211

Merged
ralflang merged 2 commits into
FRAMEWORK_6_0from
feat/pointerdrag
Jul 24, 2026
Merged

feat(core): pointerdrag.js pointer-events based drag toolkit#211
ralflang merged 2 commits into
FRAMEWORK_6_0from
feat/pointerdrag

Conversation

@ralflang

@ralflang ralflang commented Jul 23, 2026

Copy link
Copy Markdown
Member

New Drag & Drop primitives library which can replace the prototypejs/scriptaculous based dragdrop2.js library.

#211 and horde/kronolith#76 together seem to fix horde/kronolith#74 (calendar event drag and drop move / resize) based on more modern javascript

@pierrefardel

Copy link
Copy Markdown
Contributor

Tested together with horde/kronolith#76 — fixes horde/kronolith#74 (drag ghost now follows the cursor when scrolling mid-drag) and the resize issues. pointerdrag.js loads and works cleanly in month and day/week views. 👍 Details in horde/kronolith#76.

@TDannhauer TDannhauer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Looks good as a shared Pointer Events drag primitive. The design (thin toolkit, consumer-owned state, fixed-position ghosts, pointer capture, click-swallow after a real drag) is the right replacement path for dragdrop2 in apps that opt in.

Together with horde/kronolith#76 this addresses horde/kronolith#74 for month-view mid-drag scroll (viewport-fixed ghost + clientX/clientY).

Notes (non-blocking)

  • Wheel/trackpad scroll mid-drag does not replay move handlers (only edge auto-scroll does). Month ghosts stay correct because they are position: fixed; consumers that derive layout from scrollTop may still want a scroll listener that replays the last pointer position.
  • Consider touch-action: none on the source while a drag is pending/active so touch does not steal the gesture.
  • releasePointerCapture only runs from destroy(); fine on normal pointerup, but a short comment would help future readers.

Approve. Do we need the Wheel/trackpad thing?

@ralflang

Copy link
Copy Markdown
Member Author

Applied review feedback in 2f24cdf:

  • touch-action: none on the source in the constructor (saved and restored in destroy).
  • External-scroll replay: pointerdrag now listens on the drag's scroll container and on window and replays the last pointermove when either scrolls. Covers wheel, trackpad, kinetic touch, and JS-driven scroll uniformly with the existing auto-scroll replay path.
  • Comment on why releasePointerCapture() only runs from destroy() (pointerup/pointercancel release implicitly per spec).

@ralflang
ralflang merged commit 53a76aa into FRAMEWORK_6_0 Jul 24, 2026
1 check failed
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.

Drag ghost does not follow the cursor when the view is scrolled mid-drag

3 participants