facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.46k stars 24.25k forks source link

Nested ScrollView is locking FlatList gestures after zoom out action released #15216

Closed facuescobar closed 6 years ago

facuescobar commented 7 years ago

Is this a bug report?

Yes, I am using react native components, with no external libraries

Environment

  1. git clone git@github.com:facuescobar/react-native-zoomable-image-list.git:
  2. run npm install
  3. open this project in Expo

Target Platform:

iOS

Steps to Reproduce

1 - Swipe left and right, zoom in/out to feel how the swiper and zoom works. 2 - Zoom out to get an scale < 1 ( Like this http://d.pr/i/2Mr2W ) Once you stop zooming, you'll see that the image get's back to original size (scale=1) 3 - Immediately after release zooming action, try to swipe left/right If the bug occurs, you should not be able to swipe right/left 4 - If you stop swiping and wait a few seconds (1 or 2 seconds) and you try, again you'll be able to swipe right/left

Expected Behavior

The user should be able to swipe left/right immediately after zoom out action.

I am assuming that there's some kind of function that locks swipe gestures of the FlatList. But I couldn't find any fix for this. I've tried enabling and disabling different ScrollView attributes, but nothing worked.

Reproducible Demo

Expo project: https://expo.io/@facuescobar/react-native-zoomable-image-list

Github project: https://github.com/facuescobar/react-native-zoomable-image-list

facuescobar commented 7 years ago

More info about this issue: The bug happens when ScrollView does not have same size as parent wrapper.

In the code you can see that ScrollView has same size as Image Size. But if I set the ScrollView width, and height same as View container (which in this case is screen size) the bug doesn't occur.

PLEASE, DO NOT CONSIDER THIS ISSUE FIXED

Setting ScrollView to have fullscreen size allows to the user to scroll to empty areas, where the image doesn't reach. Like this: http://d.pr/i/HvTWm You can test this in this branch: https://github.com/facuescobar/react-native-zoomable-image-list/compare/fullscreen-scrollview


The bug happens when ScrollView doesn't have the same size as its parent Element.

Please, it is necessary to fix this, let me know if you need any extra information! Thanks!

pull-bot commented 6 years ago

Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!

If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:

If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.