I have a grid with items which contains buttons in them. But when I tried to click on them, first the dragStart event for grid is triggered and button click won't work.
Is there anyway to prioritize the button click over the dragStart event?
Use dragStartPredicate function (see documentation). Returning false will ignore dragging.
dragStartPredicate: function (item, hammerEvent) {
// Don't drag if target is button
if (hammerEvent.target.matches("button")) {
return false;
}
// handle Drag
return true;
},
Most helpful comment
Use dragStartPredicate function (see documentation). Returning false will ignore dragging.