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

What is the best way to remove a swipe handler from a page? #359

Open
ppetree opened this issue Dec 21, 2019 · 0 comments
Open

What is the best way to remove a swipe handler from a page? #359

ppetree opened this issue Dec 21, 2019 · 0 comments

Comments

@ppetree
Copy link

ppetree commented Dec 21, 2019

Most frameworks load pages into the dom and when the user navigates away from that page it's removed from the dom and replaced with the page the user wants and when that happens the swipe hander(s) for the page being discarded are useless and just taking up memory. What's worse is that when the user navigates back to that page, the swipe handlers get set again.

So, what's the best way to remove a swipe handler from a page? Do you @mattbryson check to see if a swipe hander is already in place and overwrite it with the new handler? Do you @mattbryson ignore the second swipe handler? If we set a second swipe handler on an element do you overwrite the first one?

    $("#element").swipe("destroy");

According to the documentation here when you employ the "destroy" method you "Destroy the swipe plugin completely. To use any swipe methods, you must re initialise the plugin."

Destroying the swipe plugin completely is a bit much and also doesn't appear to be true.

I think this needs to be cleared up (especially in the documentation).

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

1 participant