Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll View doesnt scroll if used inside ModalBox #38

Open
gs-akhan opened this issue Jan 23, 2016 · 22 comments
Open

Scroll View doesnt scroll if used inside ModalBox #38

gs-akhan opened this issue Jan 23, 2016 · 22 comments

Comments

@gs-akhan
Copy link

The title explains it .

Thanks

@kinhunt
Copy link

kinhunt commented Jan 28, 2016

+1

@maxs15
Copy link
Owner

maxs15 commented Jan 28, 2016

Hmm I guess there is a conflict with the pan responder.
Will check that, thanks for the feedback

@maxs15
Copy link
Owner

maxs15 commented Jan 28, 2016

I could reproduce this issue.
For now you have an easy way to make your ScrollView works, just define the swipeArea property.
The touches outside of this area will respond to the ScrollView.

@maxs15
Copy link
Owner

maxs15 commented Jan 28, 2016

I would like to implement the possibility to close the modal only if the ScrollView is at the top or reached the end but that's another feature :)

@kinhunt
Copy link

kinhunt commented Jan 29, 2016

@maxs15 tried with swipeToClose={false} swipeArea={0}

problem still exists with ListView inside

@maxs15
Copy link
Owner

maxs15 commented Jan 29, 2016

Android or IOS ?
It worked on my side running on IOS

@gs-akhan
Copy link
Author

IOS

@maxs15
Copy link
Owner

maxs15 commented Jan 29, 2016

Could you please check with the Example in the project ?
Let's take the first Modal as an example, just add the swipeArea property and wrap the content with a ScrollView.
You should have something like that:

<Modal style={[styles.modal, styles.modal1]} ref={"modal1"} swipeToClose={this.state.swipeToClose} swipeArea={50} onClosed={this.onClose} onOpened={this.onOpen} onClosingState={this.onClosingState}>
          <ScrollView contentContainerStyle={styles.modal}>
            <Text style={styles.text}>Basic modal</Text>
            <Button onPress={this.toggleSwipeToClose} style={styles.btn}>Disable swipeToClose({this.state.swipeToClose ? "true" : "false"})</Button>
          </ScrollView>
</Modal>

@gs-akhan
Copy link
Author

gs-akhan commented Feb 7, 2016

Sure will check it out..
Thanks

@BenjaminPaap
Copy link

I had a similar issue with this modalbox. I just disabled all handlers of the PanResponder when swipeToClose is false and it worked perfectly. I don't know if thats the correct way but none of these hints helped to solve the problem on my iOS device (iPhone 6). You can review my changes here: BenjaminPaap@4903c19

I'm handling the open and close completely manually.

@BenjaminPaap
Copy link

I have to add, that it is not a simple ListView. Instead it is a RefreshableListView (https://github.com/jsdf/react-native-refreshable-listview)

@maxs15
Copy link
Owner

maxs15 commented Feb 10, 2016

I'll check that as soon as I can, looks like the pan responder stop the propagation on the events

@maxs15
Copy link
Owner

maxs15 commented Feb 18, 2016

There is indeed an issue with a ListView component inside the ModalBox.
For now you could just use the swipeArea property, that way the user will only be able to swipe at the top of the modal.
I'll plan to integrate the ListView support but I need some time to think about it.
Would love to integrate it working the same way as the Pictures modal works on the Facebook app.
When you reach the end of the list, it will slide to the top !

@dcflow
Copy link
Contributor

dcflow commented Feb 22, 2016

It's strange that it doesn't respond at all with the ListView. Maybe changing something at contentContainerStyle property of ListView could fix it?

@DurgaManickam
Copy link

Mention height for the scrollview it will scroll even with the listview

@maxs15
Copy link
Owner

maxs15 commented Apr 18, 2016

I've updated to Example folder with a test using a ScrollView.
Everything is working on my side

@Chris-Petty
Copy link

Chipping in that on RN 0.30 using a ListView in the modalBox, @DurgaManickam correctly points out that giving the ListView a height in the style makes the ListView scroll as expected.

@azanli
Copy link

azanli commented Mar 11, 2018

Wrapping the ScrollView inside a View within the Modal should make it work.

@farzadso
Copy link
Contributor

@maxs15 Thanks for supporting ScrollView, but it only works when the entire modal contents are wrapped with a component. What if we want just one part of our modal contents to be scrollable?

untitled

@herarya
Copy link

herarya commented May 23, 2018

@maxs15 thanks bro, work 💯

@msqar
Copy link

msqar commented Jan 26, 2019

Hola, en el modalbox al comienzo de correr la app, me permite el scroll pero luego de soltar no me deja hacer scroll en ninguno de los modales

English bro, use google translate at least... i'll translate it for you this time, i'm argentinian.

"Hi, in modalbox whenever i start the app, it allows me to scroll but after releasing it won't let me scroll in any of the modals that i have"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

12 participants