question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Horizontal ScrollView inside Tab component doesn't work

See original GitHub issue

I’m using NativeBase scrollable Tabs and each tab contains a horizontall ScrollView on top and some other contents under the ScrollView. The issue is when I try to scroll the contents inside ScrollView, it does not move and instead, the page (or Tab) scrolls to the other page or tab.

I want to keep locked={false} to slide between tabs. If I set locked = {true} the scrollview works but not the page content sliding.

Anyone knows how to fix this?

react-native : 0.49.3 native-base : 2.3.3

Expected behaviour

ScrollView scrolls horizontally

Actual behaviour

Scrolls to the next tabbed page

Steps to reproduce (code snippet or screenshot)

This is my code


render() {
        return (
            <Tabs renderTabBar={()=> <ScrollableTab />} style={tabsStyles.tab} initialPage={2}
                  onChangeTab={page => this.tabChanged(page)}
                  locked={false}>
                 <Tab heading="Tab One">
                       <ScrollView
                          horizontal
                          showsHorizontalScrollIndicator={false}
                        >
                      <Image source={...}> // There are several images here
                  </ScrollView>
                      <PageContent> // This could be any page content
                  </Tab>
                 <Tab heading="Tab Two">
                       <ScrollView
                          horizontal
                          showsHorizontalScrollIndicator={false}
                        >
                      <Image source={...}> // There are several images here
                     </ScrollView>
                      <PageContent> // This could be any page content
                  </Tab>
                  <Tab heading="Tab Three">
                       <ScrollView
                          horizontal
                          showsHorizontalScrollIndicator={false}
                        >
                      <Image source={...}> // There are several images here
                     </ScrollView>
                      <PageContent> // This could be any page content
                  </Tab>
           <Tabs>
        );
    }

I tested on Android, not sure about iOs

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
ranpacocommented, Jun 11, 2019

setting locked={true} for Tabs components it worked for me. but still it is a bug very annoying.

1reaction
anurag060commented, Dec 3, 2019

any solution other than setting locked={true}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Horizontal scroll View not scroll? - react native - Stack Overflow
i am working with a react native project but ...
Read more >
ScrollView - React Native
Component that wraps platform ScrollView while providing integration with touch locking "responder" system.
Read more >
Prototype scrolling with overflow behavior - Figma Help Center
Select the frame in the canvas. Open the Prototype panel in the right sidebar. Update the overflow behavior, choose from: No Scrolling; Horizontal...
Read more >
react-native-tab-view - npm
React Native Tab View. A cross-platform Tab View component for React Native. Implemented using react-native-pager-view on Android & iOS, ...
Read more >
React Native ScrollView Component - GeeksforGeeks
It provides the scroll functionality in both directions- vertical and horizontal (Default: vertical). It is essential to provide the ScrollView ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found