Capturing grid item click event
See original GitHub issueIs it possible to capture the grid item’s click and cancel the drag event? I want to open a modal window when a grid item is clicked, but I can’t figure out how to implement this. I’m capturing the click with onClick, but stopPropagation and preventDefault don’t prevent the mousedown event that starts the dragging process.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:18 (8 by maintainers)
Top Results From Across the Web
Capturing grid item click event in react-grid-layout
I want to open a modal window when a grid item is clicked, but I can't figure out how to implement this. I'm...
Read more >Capture Grid column click event | React - EJ 2 Forums
Is it possible to capture click event on grid's column header? The solution suggested on Vue forum does not work for me ->...
Read more >capture event click in gridview - MSDN - Microsoft
I have button in gridview (each row i have a button).So i want to capture this event click button. So how can i...
Read more >Capturing grid item click event in react-grid-layout-Reactjs
Coding example for the question Capturing grid item click event in ... You will have to use nested element to capture clicks <div...
Read more >Capture the add Event - Kendo UI Grid for jQuery
The Kendo UI Grid does not provide a built-in solution for capturing its add event when the user clicks the button. However, you...
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
This may help
But you can achieve same effect using state and static elements or draggableCancel selectors.
Cheers @nikolas. I went for the idiomatic hacky way but with the lowest friction to sort this out on both firefox and chrome as event handling behave differently. I listen for
onDrag(was not working withonDragStart) and ononDragStop, setting a flag. Once dragging is done I reset that flag with a bit of delay, otherwise onClick is triggered. Simply put the flag is used to secureonClick. Same logic is used for resize. Hope that can help: