Monaca Onsen UI Discord Chat Github Repo

Make ons-tabbar swipe on one axis only



  • Hi Community!

    I’m having an application with an ons-tabbar as the main UI element. In each ons-tab I have scrollable contents, like a series of ons-cards. If I swipe exactly vertically in each ons-tab, my content scrolls vertically as well, and everything behaves as expected. But even a slight movement on the x-axis while swiping will trigger the swipe-left or swipe-right action and will show the edge of the lateral ons-tab.
    Ideally, I would like to swipe between tabs only when the swipe gesture is exactly horizontal. Take the Instagram app as an example. You can’t change from, say, “Home” to “Explore” unless you start the swipe gesture strictly horizontally.
    How is this achieved in ons-tabbar? I already know how to disable the swipe.

    Thanks!