-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OnClick event is not firing #2092
Comments
You can use draggableCancel in the area where you need the click to happen to disable the drag event.
|
@l-bianchi how does it was working with version 14.2 i need both click and drag should work on grid item.. we are displaying menus as tiles and let the user rearrange the items by drag and drop. and also when clicks on the item we navigate to different page. Is there not a way to make both drag & click works on whold grid item as in 1.4.2. thanks |
I had an issue similar to yours where my buttons in the draggable item where not clickable because of the drag event and i fixed it by setting the buttons area as draggableCancel. If you need the whole area to be clickable I imagine it to be a bigger issue because you need to discriminate between the drag start and the click. Maybe in the onDragStart event you can implement some custom logic to recognize the click. |
i have already solved via hacking drag events ondragstart, ondrag and ondragend. since it was working with 1.4.2 i was wondering why the behaviour is changed with new version. |
Same here. I roll back to 1.4.2 because I need both (click&drag) in my dashboard widgets. @last-Programmer: can you paste your custom events? |
Describe the bug
When i attach onlick event to grid item it is not firing on onclick.
This was working with version 1.4.2. From version 1.4.3 on wards it is not working. Please see the attached sand box.
Your Example Website or App
https://codesandbox.io/p/sandbox/zealous-platform-jffkrw
Steps to Reproduce the Bug or Issue
Go to the attachd sand box and click on a item and you can see that the click event is not firing.
Expected behavior
When the user clicks the item a messagebox has to be displayed but it is not firing the click event on the grid item.
react-grid-layout library version
1.5.0
Operating System Version
Windows
Browser
Chrome
Additional context
No response
Screenshots or Videos
No response
The text was updated successfully, but these errors were encountered: