onswipe beahavior
When I add onswipe to all items in a list is disables the default scroll up/down swipe (on Galaxy Tab) how could I change this for the else when I don’t make use of event.direction?
Submitted by Terje Pedersen on 4 July 2011 at 11:19
Issue Log
Currently, any event handler stops the propagation (bubbling) of the event. In the next version I’m considering disabling this, which would mean that if you swipe you would still get the default swipe behavior (i.e. move up), unless you explicitly prevent the default behavior. This would likely solve your problem. Others also have problems with this.
Seems like I have reported this issue twice (https://yellowgrass.org/issue/mobl/199).
Still have problems with this in our app.
application onswipetestimport mobl::ui::generic
screen root() {
header(“onswipetest without onswipe”)
group {
list(n in range(1,15)) {
item() { label(n) }
}
}header("onswipetest with onswipe") group { list(n in range(1,15)) { item(onswipe={ alert(event.direction); }) { label(n) } } }
}
You can’t swipe the second list. Is there any method to call for letting it swipe when onswipe doesn’t give right or left? It seems that onswipe doesn’t get called at all when other swipes than left or right happens.
The problem is that swipes up and down are scroll gestures, which is why they do not trigger an
onswipe
event. However, in a future version I intend to change the event handling behavior a little bit, enabling more control over event handing, preventing bubbling and default behavior so that you could implement a swipe up either with scroll or blocking the scroll.
Currently I just want the default to work aswell as left and right swipe.
Log in to post comments