This repository has been archived by the owner on Sep 1, 2020. It is now read-only.
Preventing propagation with nested menus involving draggable elements... #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello vkbansal!
Before explaining this, I just want to say thank you for building this awesome project! It has helped immensely with my current work. I was able to use this seamlessly with 'react-dnd'. I am not permitted to share the source of what I have been working on that helped me discover the following issue.
I have been working on a project (react v15.6.1) where I have draggable elements/boxes upon droppable grid cells where both the grid cells and the draggable elements have context menus attached. Everything worked perfectly, except for when I am using the holdToDisplay (this is happening both on mobile and desktop). For some reason, on desktop and mobile devices (like the iPad), whenever I click/touch & hold on one of the elements/boxes (on top of the grid cell), it will open up the menu of the grid cell instead of the menu of the nested element. In other words, the event propagates to the parent, which is what I don't want.
I understand that the nested menu example on your demo page is working. But in my case, using react-dnd and their html5/touch backends, it is not.
While I unfortunately do not have an example fiddle to show (since I don't have the time at the moment), I do have this pull request, adding 2 simple lines which I have confirmed (on both desktop and mobile) fixes my issue.
All tests passed. Let me know what you think...
Thanks,
AJ