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.

scrollEnabled={false} does not work for IOS

See original GitHub issue

scrollEnabled={false}

does not work on IOS 12.x.x.

Versions:

"react": "16.8.1",
"react-native": "0.61.3",
"@react-native-community/viewpager": "2.0.1",

Codes:

<ViewPager
style={{flex: 1}}
initialPage={0}
keyboardDismissMode="on-drag"
scrollEnabled={false}>
 <View key="1">
   <Text>First page</Text>
 </View>
 <View key="2">
   <Text>Second page</Text>
 </View>
</ViewPager>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
namo-topcodercommented, Nov 6, 2019

Same here for me. Works on android and not on IOS. On IOS you are still able to scroll. Please assist.

1reaction
safeer-ahmedcommented, Dec 10, 2019

I had the same issue and get it solved by removing paddingTop from parent of ViewPager. It was working fine in Android and iOS-13 but not in below versions of iOS.

Here is what which solved issue for me.

            < View style={{
                ...otherStyle,
                //paddingTop: 20, have to remove it from here and put it in child view of viewpager.
            }} >
                <ViewPager
                    scrollEnabled={false}
                    initialPage={0}>
                    <View
                        key="1"
                        style={{
                            flex: 1,
                            paddingTop: 20//used padding here and its working.
                        }} >
                        {/* view here */}
                    </View>
                </ViewPager>
            </View>

If anybody can shower light on its reason, it would be great.

Read more comments on GitHub >

github_iconTop Results From Across the Web

scrollEnabled={false} does not work for IOS · Issue #96 - GitHub
Hey, I have tested above code and it seems to work. I provide you a reproduce repo https://github.com/troZee/viewPagerExample.
Read more >
UITextView scrollEnabled = YES not working after set ...
The problem is that in iOS 8, contentSize is not adjusted correctly when scrollEnabled is changed. A small adjustment to your ...
Read more >
ScrollView - React Native
Causes the scrollbars not to turn transparent when they are not in use. Type, Default. bool, false. pinchGestureEnabled. iOS. ​. When true, ...
Read more >
Disabling Scrolling then Setting C… | Apple Developer Forums
In other words what I'm having issues with is the scrollEnabled=false because it automatically bounces the scroller of the UITextView to top.
Read more >
ScrollView - React Native
When true, the scroll view stops on multiples of the scroll view's size when scrolling. This can be used for horizontal pagination. The...
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