Skip to content

Conversation

@Titozzz
Copy link
Collaborator

@Titozzz Titozzz commented Sep 19, 2018

No description provided.

@Titozzz
Copy link
Collaborator Author

Titozzz commented Sep 19, 2018

Should this be unified with https://facebook.github.io/react-native/docs/webview#bounces?

*/
class WebView extends React.Component<WebViewSharedProps, State> {
static defaultProps = {
overScrollMode: 0,
Copy link
Member

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,
  // ...

Copy link
Collaborator Author

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?

Copy link
Member

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?

Copy link
Contributor

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

Copy link
Member

Choose a reason for hiding this comment

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

* 2 = never
* @platform android
*/
overScrollMode?: ?number,
Copy link
Contributor

Choose a reason for hiding this comment

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

Flow type looks good! 👍

Copy link
Contributor

@empyrical empyrical Sep 20, 2018

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),

@Titozzz Titozzz changed the title Added Android overscroll property (Need testing) Added Android overscroll property Sep 21, 2018
@Titozzz
Copy link
Collaborator Author

Titozzz commented Sep 21, 2018

Updated to string, WDYT?

*/
class WebView extends React.Component<WebViewSharedProps, State> {
static defaultProps = {
overScrollMode: 'always',

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'.

Copy link
Collaborator Author

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

@jamonholmgren
Copy link
Member

@Titozzz Can you add a note in the API reference in ./docs?

@Titozzz
Copy link
Collaborator Author

Titozzz commented Oct 5, 2018

Will sure do

@Titozzz Titozzz changed the title (Need testing) Added Android overscroll property [FEATURE]: Added Android overscroll property Oct 15, 2018
@Titozzz Titozzz added the Type: feature request New feature or request label Oct 15, 2018
Copy link
Member

@jamonholmgren jamonholmgren left a comment

Choose a reason for hiding this comment

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

This looks good.

@Titozzz Titozzz merged commit 2c0059f into master Oct 17, 2018
@Titozzz
Copy link
Collaborator Author

Titozzz commented Oct 17, 2018

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Titozzz Titozzz deleted the feature/android-overscroll branch October 17, 2018 16:02
@recepkocur
Copy link

This job, okay? overscroll feature is not working

phuongwd pushed a commit to phuongwd/react-native-webview that referenced this pull request Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: feature request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants