Results 1 to 2 of 2

Thread: TabPanel tabbar scrolling - can I prevent selecting whilst scrolling?

  1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    54
    Answers
    1

    Default TabPanel tabbar scrolling - can I prevent selecting whilst scrolling?

    I'm doing a Sencha app for DailyMailOnline - it has loads of items on the bottom tabbar with horizontal scrolling (you can download the native android phone app for an example). The native android version allows you to scroll through the icons on the bottom tabbar without accidentally activating the item that is touched when scrolling, but the Sencha equivalent always loads the item that is touched, even if it is not 'clicked'.

    Is there a way to deactivate the tabbar items so that they only respond to a 'click' and not a 'touchdown' please?

    Code:
    Ext.extend(Ext.TabPanel, {
        tabBar: {
        scroll: 'horizontal',
            dock: 'bottom',
            layout: {
                pack: 'center'
            }
        },
        fullscreen: true,
        cardSwitchAnimation: {
            type: 'slide',
        },
        ....

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449
    Answers
    3997

    Default

    You can try to listen for when the scroll starts to not allow tab switching and on scroll end to then allow it. I would set a property on the tabpanel and listen for the beforecardswitch and return false if this property is true.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •