Dismiss popover if a drag and drop event occurs #1208
Merged
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.
Here is the issue. The dragListGroup component (from closure and used by the ngeo sortable directive) listen on a 'mousdown' event. When the event occurs, the component clone the node (in our case a gmf-Layertree node). So the DOM element dragged is a clone.
Definition of a click event:
Therefore when the device button is released, the element behind the pointer is not the same as when the mousdown event occurred. So neither the original element nor the cloned one won't trigger a click event.
That's why the click event do not occur and will never occur.
We can't use a clic event.
@pgiraud @fredj Let me know if you think I missed something
Demo: https://oliviersemet.github.io/ngeo/pr-dismiss-popover-on-drag-and-drop-event/examples/contribs/gmf/apps/desktop/index.html
source: click definition