Adding data-drag-handle doesn't always work
See original GitHub issueDescribe the bug
On a simple component, like the drag handle example, adding data-drag-handle
makes dragging only work for that element.
On something more complicated, it doesn’t.
Steps to Reproduce / Codesandbox Example
- Go to https://codesandbox.io/embed/simplified-tiptap-editor-example-5s2k3
- Drag one of the “Set of fields” blocks from anywhere.
Expected behavior
Dragging should only work when dragging from the handle (the darker box on the top right with the =
)
Additional context
I know that something could probably be done using stopEvent
, but I can’t work out what.
I tried something along those lines, but it would also affect events within the nested inputs.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Adding data-drag-handle doesn't always work #481 - GitHub
Describe the bug On a simple component, like the drag handle example, adding data-drag-handle makes dragging only work for that element.
Read more >React beautiful DnD drag out of position problem
I tried it, but doesn't work for me. I have a parent div which uses a transform, and that is causing the issue....
Read more >Drag operations - Web APIs - MDN Web Docs - Mozilla
When the drag begins, you add data by providing a type and the data. ... This will often be true, but doesn't need...
Read more >Row Dragging - JavaScript Data Grid
Row dragging is used to rearrange rows by dragging the row with the mouse. Download v28 of the best JavaScript Data Grid in...
Read more >Drag and Drop functionality using react-beautiful-dnd
React-beautiful-dnd makes it easy to create drag and drop functionality, allowing you to drag and drop (dnd) in rows or columns just like...
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
@Greenscreener Could you please provide a code sample? I’m struggling with this right now. I tried adding the hidden div as suggested by the OP but that did not work for me. I’m able to click and drag but when I drop the element stays in it’s original position.
Thank you. After a comparison the only difference I could find is that I was extending Mark and the example extends Node. After changing my element to extend node I can now drag and drop!