bug of unbinding swipeleft/swiperight handler #7351

Closed
egana opened this Issue Apr 27, 2014 · 0 comments

Projects

None yet

2 participants

@egana
egana commented Apr 27, 2014

When I bind both 'swipeleft' and 'swiperight' handler to the same element and then unbind the 'swiperight' handler, 'swipeleft' event handler is no longer fired.

Test:
http://jsbin.com/acIRUBo/66/edit
In the above test page, first 'swipeleft' and 'swiperight' handler is bound to #target element.
By the clicking the button, 'swiperight' handler is unbound. Since 'swipeleft' handler is not unbound, you expect that 'swipeleft' handler is still fired, but actually it's not fired anymore.

In fact, at the following line, when teardown 'swiperight' event handler, all the 'swipe' handler is unbound.
https://github.com/jquery/jquery-mobile/blob/18f872d0174e418c0ac1433267a1e9ea13a4263a/js/events/touch.js#L325

@gabrielschulhof gabrielschulhof self-assigned this Apr 27, 2014
@gabrielschulhof gabrielschulhof added this to the 1.4.3 milestone Apr 28, 2014
@gabrielschulhof gabrielschulhof added a commit that referenced this issue May 23, 2014
@gabrielschulhof gabrielschulhof Swipe: Keep swiperight when tearing down swipeleft and vice versa
(cherry picked from commit 0eba6e4)

Closes gh-7353
Fixes gh-7351
65e81c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment