Skip to content
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

Dismiss popover if a drag and drop event occurs #1208

Conversation

olivierSemet
Copy link
Contributor

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:

The click event is fired when a pointing device button (usually a mouse button) is pressed and released on a single element.

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

@olivierSemet
Copy link
Contributor Author

fixes #1100

@fredj
Copy link
Member

fredj commented May 17, 2016

The problem with this solution is that the opacity slider can't be "slided": as soon as the thumb is clicked the popover is closed

@olivierSemet
Copy link
Contributor Author

@fredj I forgot to change a click handler to a mousedown handler, should be ok now

@olivierSemet olivierSemet force-pushed the pr-dismiss-popover-on-drag-and-drop-event branch from 886d6b5 to a5e4933 Compare May 17, 2016 16:51
@fredj
Copy link
Member

fredj commented May 31, 2016

still not working in your demo, please update it

@fredj
Copy link
Member

fredj commented Jun 1, 2016

  • open the menu
  • mousedown the slider thumb
  • the menu is closed

@olivierSemet
Copy link
Contributor Author

ok thanks @fredj

@olivierSemet
Copy link
Contributor Author

@fredj I updated the gh pages. The code is fine, the demo just didn't use the right one

@fredj
Copy link
Member

fredj commented Jun 1, 2016

demo looks good, thanks

@fredj fredj merged commit d9454f1 into camptocamp:master Jun 1, 2016
@olivierSemet olivierSemet deleted the pr-dismiss-popover-on-drag-and-drop-event branch July 5, 2016 08:55
@sbrunner sbrunner added this to the Older milestone Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants