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

Elements within the <panzoom> with <Draggable> #18

Closed
armikhael opened this issue Aug 20, 2014 · 5 comments
Closed

Elements within the <panzoom> with <Draggable> #18

armikhael opened this issue Aug 20, 2014 · 5 comments

Comments

@armikhael
Copy link

Hi I worked for the elements within the PanZoom with draggable, and the change made ​​in the branch testing-drag-drop.

I have a problem adding draggable the items I can not prevent the Panzoom move when selected, how could I do to move the item is independent of PanZoom but still within.

@armikhael armikhael changed the title Elements within the <panzoom> with <Drag-Drop> Elements within the <panzoom> with <Draggable> Aug 29, 2014
@mvindahl
Copy link
Owner

Hi armikael,
Sorry, I'm awfully sorry for not having seen your notfication sooner. Did you find a solution for your problem?
Regards,
/Martin

@armikhael
Copy link
Author

hello mvindahl

If you can solve my problem.

The objects within the Pan-Zoom are also agrege Draggable and one drag- drop.

https://github.com/armikhael/angular-pan-zoom/tree/testing-drag-drop

test.dev.html

@mvindahl
Copy link
Owner

Hi Carlos,
As far as I can see, you can drag items onto the list which is contained in the panzoom element. However, when you try to drag them away, the whole thing pans instead .. right?
Off the top of my head I don't have a solution for this. I would argue that from a UX viewpoint it would be confusing if pan and drag gestures are mixed in this way. It would be hard for the user to foresee exactly what would happen.
For that reason I would suggest not using the panzoom widget in this case. Instead, an old fashioned div with scrollbars would do the trick.
Best regards,
/Martin

@equus71
Copy link
Contributor

equus71 commented Oct 12, 2014

Hi armikael,

I have done the app solving a similar problem. I had some kind of a map (panzoomable with angular-pan-zoom) and some markers on it which were draggable.

The main part is to prevent the angular-pan-zoom to get the event that drag have started ("mousedown" event).
I have made custom directive for my draggable elements basing on the example from the angular's docs (https://docs.angularjs.org/guide/compiler).
To the function handling "mousedown" event I had to just add "event.stopPropagation();".
This way you can have draggable elements within the angular-pan-zoom.

All the best

@mvindahl
Copy link
Owner

Thanks for the input equus71. Stopping the mouse events from propagating to the panzoom directive seems like the correct solution. Since this is not really an issue with angular-pan-zoom I'll take the liberty of closing the issue.

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

No branches or pull requests

3 participants