-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[FEATURE]: Added Android overscroll property #54
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
Conversation
|
Should this be unified with https://facebook.github.io/react-native/docs/webview#bounces? |
js/WebView.android.js
Outdated
| */ | ||
| class WebView extends React.Component<WebViewSharedProps, State> { | ||
| static defaultProps = { | ||
| overScrollMode: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add some constants for these modes:
OVER_SCROLL_ALWAYS = 0
OVER_SCROLL_CONTENT = 1
OVER_SCROLL_NEVER = 2
So then this would be something like
static OVER_SCROLL_ALWAYS = 0
static OVER_SCROLL_CONTENT = 1
static OVER_SCROLL_NEVER = 2
static defaultProps = {
overScrollMode: OVER_SCROLL_ALWAYS,
// ...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to expose thoses values to the user ? or are you just trying to make the internal code clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question -- I feel we need them either way, but exposing to the user seems like a good idea. Your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if it was changed to use a string, rather than a number? Like:
overScrollMode?: 'always' | 'content' | 'never',And on the android side, it converted the strings back to their appropriate numbers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like that idea @empyrical, and it would fit with some other properties, like this one:
js/WebViewTypes.js
Outdated
| * 2 = never | ||
| * @platform android | ||
| */ | ||
| overScrollMode?: ?number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flow type looks good! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually - perhaps this would be better:
overScrollMode?: ?(0 | 1 | 2),
|
Updated to string, WDYT? |
| */ | ||
| class WebView extends React.Component<WebViewSharedProps, State> { | ||
| static defaultProps = { | ||
| overScrollMode: 'always', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe content makes more sense as default? It's basically 'auto'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well android default is always, I think we should not alter the current behavior
|
@Titozzz Can you add a note in the API reference in |
|
Will sure do |
jamonholmgren
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good.
|
🎉 This PR is included in version 2.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
This job, okay? overscroll feature is not working |
No description provided.