question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Destroy method should reset changes

See original GitHub issue

Enabling Panzoom and then calling destroy() leaves a bunch of artifacts like cursor:move on the image, overflow:hidden on the parent, etc. Those changes should be undone after Panzoom is removed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
timmywilcommented, Mar 16, 2021

Ok, rather than changing the behavior of destroy, which would technically be a breaking change and warrant a major version release, I added a new method for resetting all of these styles.

const panzoom = Panzoom(elem)
// ...
panzoom.destroy()
panzoom.resetStyle()
0reactions
timmywilcommented, Mar 16, 2021

I think this is generally how styles set by libraries are reverted. The value can then go back to whatever is set in CSS files or browser defaults. Note that getting computed styles can have side-effects like reflows, which can cause flashes. I could just check the style attribute, but saving all that is a good chunk of code. If you have a style you’d like it to be that isn’t the browser default, just set it in your CSS file rather than in the style attribute.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undo possibilities in Git - GitLab Docs
Undo remote changes without changing history. To undo changes in the remote repository, you can create a new commit with the changes you...
Read more >
Can I delete a git commit but keep the changes?
You can revert a specific commit while keeping the changes in your local files by doing: git revert -n <sha>. This way I...
Read more >
Git Reset | Atlassian Git Tutorial
Git reset is a powerful command that is used to undo local changes to the state of a Git repo. Explore its 3...
Read more >
On undoing, fixing, or removing commits in git - Seth Robertson
On branch master # Changes to be committed: # (use "git reset HEAD <file>. ... WARNING: These techniques should only be used for...
Read more >
How do I “git pull” and overwrite my local changes?
Can I keep local commits? You can! one simple approach is, to make a local branch from the branch you are on before...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found