Skip to content

How to set up a scrollview in interactive element? #2

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

Closed
JakeHadley opened this issue Sep 14, 2019 · 6 comments
Closed

How to set up a scrollview in interactive element? #2

JakeHadley opened this issue Sep 14, 2019 · 6 comments

Comments

@JakeHadley
Copy link

JakeHadley commented Sep 14, 2019

Environment

  • Android or iOS: Yes
  • Simulator or Device make/model: Android OnePlus 6T
  • react-native: 60.4
  • react-native-interactable(interactive): 0.1.15

Context

Trying to make a bottom sheet type interactive element

Expected Behavior

ScrollView should work as expected.

Actual Behavior

...Scrollview does not work as expected...

Steps to Reproduce

Can't seem to get a snack working: https://snack.expo.io/S1uwiRtLB
It's the map example from Interactable. Just copy and paste the inner content a few times and add a scrollview. Profit.

@woodpav
Copy link
Owner

woodpav commented Sep 14, 2019

Use my package. react-native-interactive on npm. Try putting the Interactive.View inside the ScrollView. If that doesnt work its probably because of problems with how Interactive.View captures touch events in which case I suggest using a PanResponder. Alternatively you can make the Interactive.View "scrollable" by including the translateY param on the transform style prop.

@JakeHadley
Copy link
Author

JakeHadley commented Sep 15, 2019

We're you able to take a look at the snack? I can't get it to work with interactive...

@woodpav
Copy link
Owner

woodpav commented Sep 15, 2019

The reason is that interactive requires native modules which usually cannot be linked on snack. Also there is no ScrollView

@JakeHadley
Copy link
Author

Oh ok. Either way, how would you modify the code on the snack to do what we want it to do? Intuitively it doesn't make sense to put the interactive in a scrollview. Should it be more like (interactive->scrollview->interactive)?

@woodpav
Copy link
Owner

woodpav commented Sep 16, 2019

I'm not goning to write code for you. No, interactive captures touch events - you'll have better luck with PanResponder. Google ScrollView in a pan responder.

@woodpav woodpav closed this as completed Sep 16, 2019
@JakeHadley
Copy link
Author

I'm not asking you to write code. I'm asking for clarification because what you were saying wasn't making much sense with the use case. But thanks for your help. I'll look into PanResponder.

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

2 participants