react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Nested scrollview is not working in react native android but working in ios ?

Open prashanthmerugucs opened this issue 11 years ago • 37 comments

<ScrollView>  
    <View> <Text>Hello</Text> </View> 
    <View><Text>Hello</Text>  </View> 
    <View><Text>Hello</Text>  </View> 
    <View><Text>Hello</Text>  </View> 
    <View>       
        <ScrollView>
            <View> <Text>Hello</Text> </View>         
            <View><Text>Hello</Text>  </View>         
            <View><Text>Hello</Text>  </View>          
            <View><Text>Hello</Text>  </View>      
        </ScrollView> 
    </View> 
</ScrollView>

prashanthmerugucs avatar Oct 09 '15 09:10 prashanthmerugucs

I think @andreicoman11 was looking into something similar.

foghina avatar Oct 15 '15 15:10 foghina

Or was it @kmagiera? :)

foghina avatar Oct 15 '15 16:10 foghina

Can you provide some more details on how it's "not working":

  1. crashing app?
  2. causing red box?
  3. not rendering anything?
  4. not scrolling?

kmagiera avatar Oct 15 '15 17:10 kmagiera

@prashanthnani Any updates?

satya164 avatar Dec 23 '15 01:12 satya164

Just my 2 cents - Android doesn't actually handle nested scroll views that well, have you tried testing the UI using native Android to see if the behaviour differs at all?

mpretty-cyro avatar Jan 13 '16 23:01 mpretty-cyro

Closing since no response. Let's re-open if you're still having the issue.

satya164 avatar Jan 26 '16 14:01 satya164

a horizontal scrollview with nested vertical scrollview will crash the app.

Android version: 4.4.4 KTU84P (MI 3)

TinChak avatar Apr 28 '16 13:04 TinChak

I think @prashanthnani means to say it's not scrolling. Same issue with me too.

minkesh avatar May 05 '16 04:05 minkesh

I have same issue too, have any ways to solve ?

dc198689 avatar May 26 '16 07:05 dc198689

Same issue here

divyekhanna avatar Nov 19 '16 13:11 divyekhanna

Same issue here

Rashhh avatar Dec 08 '16 07:12 Rashhh

Same issue here

colin3dmax avatar Jan 03 '17 13:01 colin3dmax

@satya164 Hey Satya, any updates on this ? Facing the same issue on RN 0.37 (android).

ranjithnori avatar Mar 02 '17 05:03 ranjithnori

No one is working on this AFAIK.

satya164 avatar Mar 02 '17 05:03 satya164

In my case it occasionally works, but it's really difficult to get the child scroller to scroll. I am wondering how scrollers are done on Android, because I can't find any reference to NestedScrollView in RN source?

I have vertical scrollers inside a horizontal (paged) scrolling parent, which is pretty much how the Facebook app works on Android. So they are doing something to get that working smoothly. Any tips @satya164? :)

ABleas avatar Mar 26 '17 05:03 ABleas

any solutions?

urnotzhaoll avatar May 12 '17 07:05 urnotzhaoll

any updates?

rajsuvariya avatar Jun 20 '17 06:06 rajsuvariya

Vertical inside vertical, or horizontal inside horizontal, is a native android problem, and there are a lot of hacky workarounds out there on stackoverflow of folks trying to fix it. I don't know much more about that.

As far having a vertical inside horizontal (or vice versa), this also appears to be a native Android problem. ScrollView children are dependent on the parent scrollview "passing" the touch event to the child. But the parent is basically configured with a certain mTouchSlop (which I can't find a way to override, even in native Java code), which causes it to absorb drags beyond that slop. Since the slop appears to be set low, it often prioritizes scrolling in the outer scrollview, and makes it difficult to scroll in the inner one.

No idea on a fix. In my case, I may need to revert back to using something like a react-native-viewpager (which handles the scroll thresholds itself in JS, and is roughly equivalent to the FlatList functionality I want). Though I recognize that only helps my specific use case, and probably won't help most of you.

mikelambert avatar Jul 01 '17 20:07 mikelambert

any updates?

Rpeanut avatar Sep 02 '17 03:09 Rpeanut

any updates?

shukerullah avatar Sep 22 '17 12:09 shukerullah