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

Enable horizontal scrolling of ScrollView from RN #121

Merged
merged 5 commits into from
Jan 31, 2020

Conversation

xxsnakerxx
Copy link
Contributor

Also contains several fixes

@xxsnakerxx
Copy link
Contributor Author

maybe also fixes #41

@@ -1,6 +1,5 @@
import React from 'react';
import { StyleSheet, Text, View, Dimensions, TextInput } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iirc I used the ScrollView from RNGH because the one from react native wasn't working on Android. Have you been able to make it work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know,

minDist={20}
activeOffsetY={20}
activeOffsetX={20}

this fixed ScrollView from RN, check examples

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use react-native-tab-view inside modalize, these changes make tabs work

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird, I've been running your code locally and I wasn't able to scroll. I was running the expo example though. I will give react-navigation a try

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the other scroll view under that you didn't try, which is a vertical scroll view?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, nested vertical RN ScrollView doesn't work on android, but maybe we can document this somehow, smth like, if you want to vertical scroll view inside vertical scroll view on android (that's antipattern, imho), please use ScrollView from RNGH! I think, support of others libraries that use horizontal ScrollView from RN is more important!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it doen't helps

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me!

src/index.tsx Outdated
@@ -86,7 +86,7 @@ export class Modalize<FlatListItem = any, SectionListItem = any> extends React.C

const fullHeight = isIos
? screenHeight
: screenHeight - (isIos ? StatusBar.currentHeight || 0 : 10);
: screenHeight - (StatusBar.currentHeight || 0);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't even notice I added isIos where it's already checked before.

Anyway, I did that by design because I find the Android margin too important. Could we expose that in a prop? I will be happy and not rechange again after merging your changes :P

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can add a prop smth like topOffset? What do you think? By default it will be ios: 0, adnroid: StatusBar.currentHeight || 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the name of the prop! topMargin???

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm fine with these default value. I would say modalTopOffset

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will do

@jeremybarbet jeremybarbet merged commit 49ec5ae into jeremybarbet:master Jan 31, 2020
@xxsnakerxx xxsnakerxx deleted the enable-x-axis branch February 1, 2020 18:05
marcinolek pushed a commit to marcinolek/react-native-modalize that referenced this pull request Feb 20, 2020
…#121)

* fix: tap on text input clear button on ios

* fix: enable nested horizontal scroll (ScrollView from RN)

* fix: statusbar.currentheight is available on android only

* fix: avoid_keyboard_like_ios should be false on android by default

* feat: modal top offset prop
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

Successfully merging this pull request may close these issues.

2 participants