React-grid-layout: Link click prevention on drag release.

Created on 10 Dec 2017  路  4Comments  路  Source: STRML/react-grid-layout

In the grid items that I am currently developing, there is a link to another location on the site. The link spans the entire size of the grid item. On occasion, when the drag event finishes the link click event is triggered, this seems to happen more often on shorter drag events.

This is the HTML structure of the grid.

<div class="grid">
    <div class="grid-item">
        <a href="/">content</a>
    </div>
    <div class="grid-item">
        <a href="/">content</a>
    </div>
</div>
  • [x] Bug
  • [ ] Feature Request
  • [x] Question
stale

Most helpful comment

On further investigation, it looks like the onClick event is triggered when the widget is dragged to a grid position that is not available.

All 4 comments

On further investigation, it looks like the onClick event is triggered when the widget is dragged to a grid position that is not available.

I have the same problem. Have you found how to fix this?

@art-mironoff I ended up timing the duration the user's mouse was pressed down on the grid item, if longer than x long, I manually instantiated the click even(url change for example).

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

Was this page helpful?
0 / 5 - 0 ratings