Skip to content

Conversation

@slorber
Copy link
Collaborator

@slorber slorber commented May 30, 2018

Currently the default implementation always align childview top to scrollview top, which may not always be a good idea, particularly if element is already fully visible into the view.

This implementation is closer to the expected behavior and closer to DOM element.scrollIntoView()

See also #216 (comment)

Currently the default implementation always align childview top to scrollview top, which may not always be a good idea, particularly if element is already fully visible into the view. This implementation is closer to the expected behavior and closer to DOM `element.scrollIntoView()` See also APSL#216 (comment)
@slorber slorber mentioned this pull request May 30, 2018
@slorber
Copy link
Collaborator Author

slorber commented Jun 7, 2018

Hey, I'm closing this PR as I've decided to support scrollIntoView into a separate dedicated library: https://github.com/slorber/react-native-scroll-into-view

@slorber slorber closed this Jun 7, 2018
@sebasgarcep
Copy link
Contributor

@slorber I've just seen your implementation and it looks fine. Any reason why you believe this functionality should be kept outside react-native-aware-scroll-view?

@slorber
Copy link
Collaborator Author

slorber commented Jul 30, 2018

@sebasgarcep

  • scrollIntoView and "keyboard aware" are separate features
  • we should be able to use both together, yet if I want to stop using this lib and replace it with KeyboardAvoidingView or something else, they should still be able to use scrollIntoView feature
  • This lib support many scrollable views and scrollIntoView feature is mostly for ScrollView which may be confusing
  • I wanted the scrollIntoView to have a lot more features and make it easy to use. Doing so in this lib means the majority of the code would not be related to keyboard anymore but to scrollIntoView, which is not the initial purpose of the library
  • I needed to go fast and iterate on a simple API without waiting for review/publication of this lib, as I consume my own code

It's possible to combine both library HOC's on a ScrollView, so if this lib need react-native-scroll-into-view features and API, it can still add it as a dependency. But I think it would be better to let that decision to the user.

@sebasgarcep
Copy link
Contributor

@slorber Thanks for taking the time to answer thoroughly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants