Re-usable drag handle example
See original GitHub issueHey, I’ve created a somewhat more re-usable drag handle example based on the example from the readme: REPL
The usage is simple:
const { dragHandleZone, dragHandle } = createDragHandle();
// on drag zone
use:dragHandleZone={{ /** dndzone options **/ }}
// on drag handle
use:dragHandle
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Example of making a reusable `draggable()` modifier for ...
Example of making a reusable `draggable()` modifier for SwiftUI Views - DraggableView.swift. ... Handle dragging. struct DraggableView: ViewModifier {.
Read more >Making of: draggable handles - Red Blob Games
I can have a separate function that takes the internal variable and sets the circle position. Let's try this with a simple example:...
Read more >How to Make a Simple Custom useDrag React Hook
Build a custom UI component with React's useEffect hook to control dragging behavior on HTML elements without third party libraries.
Read more >Draggable Reusable JavaScript Panel - CodeProject
Reusable draggable JavaScript panel with dynamic content. ... The draggable panel handles the click events, drag and minimize functionality.
Read more >Create an Easy Custom React Hook for Dragging Components
That's why today I'm going to work with you and help you build your own reusable hook to create draggable components.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@zahachtah good catch. the official example (no action) had the same issue. the fix is to add mouseup and touchend listeners to the handle and have them disable drag. the same solution should work for the action. i will fix when i have a chance
I’m trying to use this action with nested zones. There is a parent list of items - zone-0. Each item has a list of sub-items - separate zone-n for each sub-items list. I thought of adding a type parameter to the dragHandle action and make the drag store a Set of drag-able types. Did anyone extend this action to support multiple zones and nested zones?