useDraggable onMouseDown handler swallows element's onClick event
See original GitHub issueGiven the code below, the handleClick is never called. Removing {…listeners} fixes the issue. It appears the listeners.onMouseDown
prevents propagation of the event.
<li onClick={handleClick} ref={setNodeRef} {...attributes}> {...listeners} <Content /> </li>
I’ve tried wrapping it with a div, wrapping Content with a div etc.
Any advice / pointers would be greatly appreciated.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
OnClick event swallowed | WinForms Forums - Syncfusion
No, the sample uses the OnMouseClick() event. OnMouseDown() is used for the right button (to view the context menu). (Interestingly for the left...
Read more >Why does jquery.blockUI swallow onClick event?
It logs every mousedown , mouseup , click and change event. It registers asynchronous change event handler on <input> thet does nothing for ......
Read more >Custom Query – jQuery UI
When I use draggable on an img, it first does the browser's drag behavior, ... If I add a handler to the mousedown...
Read more >Event delegation order - Hotwire Discussion
I add a mousedown event listener to the container to capture an interaction which does a “reorder in place”. This is done using...
Read more >HTML5 CSS3 Genius Guide Volume 3 PDF - Scribd
Then, a click handler called 'Play' is then bound apply bespoke efects. to the button. The play function provides playing and HYPERREALITY
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 FreeTop 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
Top GitHub Comments
Set an
activationConstraint
on the Mouse or Pointer sensor that is either based ondistance
ordelay
: https://docs.dndkit.com/api-documentation/sensors/pointer#activation-constraints@clauderic for your reference: https://codesandbox.io/s/dndkit-k75i3?file=/index.tsx
It works 100% as expected. I’m trying to see what I’m doing wrong in my project.
Created a NextJS version as I assumed it could be related to SSR. Works as expected too. https://codesandbox.io/s/dndkitnext-tp03l