drag-patterns
CommunityMake drag interactions rock-solid in Vue.
Software Engineering#vue#canvas#drag-and-drop#event listeners#pointer events#pan zoom#resize handles
Authorjonaseck2
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill solves flaky, broken, or jittery drag behavior in Vue components caused by fast pointer movement, event listener scope, and coordinate math mismatches inside transformed containers.
Core Features & Use Cases
- Window-level drag listeners: Prevent drags from dying when the cursor leaves the element by wiring
mousemove/mouseuponwindow. - Clean separation of cleanup vs state reset: Avoid wiping reactive drag state by ensuring listener removal and state resetting are independent.
- Pointer-events kill switch during drag: Stop nested elements from intercepting pointer events mid-gesture via a
.draggingCSS class. - Screen-pixel drag math with deferred conversion: Track movement in
clientX/clientYpixels and convert to fractions/percentages only when persisting. - Overlay positioning that survives zoom and resize: Use percentage-based overlay positioning inside CSS-transformed containers.
- Async race guards: Prevent stuck state from async reloads and avoid rendering overlays before image natural dimensions are known.
- Practical integration guidance: Targets real production touchpoints like image tag overlays, chart pan/zoom, resizable column splitters, and panel resizers.
Quick Start
Use the drag-patterns guidance to implement your Vue drag interaction by attaching temporary mousemove/mouseup handlers to window, disabling pointer-events during the drag, and saving positions only after converting from screen pixels.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: drag-patterns Download link: https://github.com/jonaseck2/slaktforskning/archive/main.zip#drag-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.