Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Support for swipe back on iOS
-
Does Onsen Ui support swipe back on iOS devices like other mobile frameworks? Couldnt find anything about in in the doc.
-
@danwan not directly. You can try to use the gesture detector functionality (docs here and here) to try to recreate your intended behavior.
-
@danwan I just posted some code for something a bit different, but for your purpose it would work. https://community.onsen.io/topic/1478/swipe-on-ons-list-via-ons-gesturedetector
Basically, just plop this bit in:
ons.ready(function(){ ons.GestureDetector(document.getElementById('myList')).on('swipeleft',function(e){ alert('swiped - '+e.target.id); }); });
Change the ID to your page ID or body ID and then handle your navigation within the function and it will work. You also have other events that @misterjunio linked too.
-
If I understand correctly I could listen to the swipe back gesture and trigger the back event, but it would not have the iOS like look and feel? Just like a normal backclick?
-
@danwan Pretty much. I don’t dev for iOS, so I am uncertain how they do it different. Can you describe that and I can try to interpret if it can be done in Onsen?
-
@munsterlander
https://www.youtube.com/watch?v=MAWhVWfxTmU 0:20 - 0:25 shows the swipe back feature. Very important for native look and feel imho and some other Frameworks support it. So I would wonder if Onsen UI is missing it
-
@danwan In short, iOS swipe back is not currently supported. It’s on the roadmap but it will take time since we need to focus on some other stuff right now :/