react-grid-layout icon indicating copy to clipboard operation
react-grid-layout copied to clipboard

Prevent dragStart event getting fired when click event happens

Open kishok opened this issue 4 years ago • 7 comments

Issue: when i click the actions in grid Item it automatically trigger the dragStart event and preventing the click functionality getting called sometimes.

Expectation: Need the PR fix #1411 mentioned here / any alternatives. please merge it the stable branch and release it. Because this is majorly impact the usability of react-grid-layout in desktops and touch devices (ex. iPad).

Note: we use this library in production that really affect the user experience.

Environment: "react-grid-layout": "^1.3.0"

kishok avatar Feb 09 '22 15:02 kishok

I have the exact same problem.

luisiacc avatar Feb 14 '22 06:02 luisiacc

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days

github-actions[bot] avatar May 15 '22 12:05 github-actions[bot]

We are also experiencing issues as described about above when users are using our app on an iPad. Users cannot click on any buttons inside react-grid-layout items but instead think the user it dragging the item the whole time. We also see this happening sometimes within HubSpot's dashboard items. Some items that can be clicked are being registered as dragging events. Are there any recommended solutions to distinguish between clicking and dragging events on buttons/links inside react-grid-layout items on an iPad?

sbecka avatar Nov 15 '23 06:11 sbecka

Trying to get around this as well.

TheBranchDriftCatalyst avatar Feb 08 '24 04:02 TheBranchDriftCatalyst

Same issue. Click events inside the item are not working, because the grid activates drag mode on click.

asinfdev avatar Feb 21 '24 16:02 asinfdev

I have the same issue.

rylm avatar Feb 27 '24 00:02 rylm

I fixed the problem on my site by setting the draggableHandle & draggableCancel props to the elements within the item. I defined the header area as draggableHandle, where the user can then drag and drop. The actual content area was provided with the class from draggableCancel.

draggableHandle='.dragHandle'
draggableCancel='.notDraggable'

asinfdev avatar Feb 27 '24 09:02 asinfdev