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

panzoom 4.2.0. breaks the drag functionality of jsplumb #496

Closed
akreienbring opened this issue Jul 17, 2020 · 7 comments
Closed

panzoom 4.2.0. breaks the drag functionality of jsplumb #496

akreienbring opened this issue Jul 17, 2020 · 7 comments
Labels

Comments

@akreienbring
Copy link

Describe the bug

Hello,
yesterday I updated from version 4.1.0 to 4.2.0. After that my (jsplumb) draggable elements could not be dragged anymore.

Your environment

  • see above
    -Chrome latest

Expected behavior

Actual behavior

  • see above

Steps to reproduce

Easiest way may be do download my repo from here and running it from the dist folder. (Description available in the README...

You'll need to "Create Table" to get the draggable element on the canvas.

Then update panzoom with npm to 4.2.0. after running "npm run webpack" there's a new distribution in the dist folder. If you start it up, dragging does not work anymore.

@akreienbring
Copy link
Author

And if you might wonder what jsplumb is, you can have a look here: https://github.com/jsplumb/jsplumb

@timmywil
Copy link
Owner

Thanks for opening an issue. I can tell you one difference between 4.1.0 and 4.2.0 that may be the culprit. Looks like you were using the disablePan option. This used to skip binding any event handlers. That was a problem because those handlers were still needed to do focal point zooming and respect the contain option, even if panning was disabled. These handlers could interfere with other libraries that do dragging because Panzoom calls event.preventDefault and event.stopPropagation on the start event. You can change that with the handleStartEvent option. Also consider event.stopImmediatePropagation conditionally in any of your handlers.

Alternatively, I've just added an option that will allow you to restore the old behavior. Pass noBind: true to Panzoom options.

@akreienbring
Copy link
Author

Yes, I definetely use the "disablePan" option in my makeTableZoomable method.

Guess that will be a 4.2.1 release? As soon as I can install it, I'll give the new option a try! Thanks for looking into this.

timmywil added a commit that referenced this issue Jul 20, 2020
# [4.3.0](4.2.0...4.3.0) (2020-07-20)

### Features

* **bind:** add bind method and noBind option ([e5e1a30](e5e1a30)), closes [#496](#496)

### Reverts

* Revert "docs(demo): remove unnecessary window declaration" ([bd299d8](bd299d8))
@timmywil
Copy link
Owner

🎉 This issue has been resolved in version 4.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@timmywil
Copy link
Owner

Released in 4.3.0.

@akreienbring
Copy link
Author

Hm... thinking about it: I heavily rely on an event that fires if the zoom animation is done. Only then I can reposition jsplumb endpoints.
To rely on "animationend transitionend..." is a workaround because panzoom does not fire an event when the css transformation has finished.

I hope that these still bubble up with the new implementation... :-)

@akreienbring
Copy link
Author

I tried the new option. Success! After upgrading to 4.3.0 and adding the option the issue is fixed! :-D

timmywil added a commit that referenced this issue Aug 6, 2020
- This method and option allows the user to control when the
  default event handlers are bound, if at all.

Close gh-496
timmywil added a commit that referenced this issue Aug 6, 2020
# [4.3.0](4.2.0...4.3.0) (2020-07-20)

### Features

* **bind:** add bind method and noBind option ([e5e1a30](e5e1a30)), closes [#496](#496)

### Reverts

* Revert "docs(demo): remove unnecessary window declaration" ([bd299d8](bd299d8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants