Skip to content

Conversation

@sebasgarcep
Copy link
Contributor

@alvaromb @TSMMark Could you please check out if my work is correct?

Copy link
Collaborator

@TSMMark TSMMark left a comment

Choose a reason for hiding this comment

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

I haven't tested it but it looks great to me


const getScrollPosition = options.getScrollPosition || this._defaultGetScrollPosition
const { x, y, animated } = getScrollPosition(parentLayout, childLayout, this.position)
this._container.scrollToPosition(x, y, animated)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does scrollToPosition return a promise / cancellable resource? If so we should return the result of the call. Sorry, I'm not intimate with the API.

return this._container.scrollToPosition(x, y, animated)

@TSMMark
Copy link
Collaborator

TSMMark commented Mar 15, 2018

For the record this is based on conversation in #216

element: React.Element<*>,
options: ScrollIntoViewOptions = {}
) => {
if (!this._rnkasv_keyboardView || !view) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

As CI pointed out, view is not defined. There are also other a few more linting issues.

@sebasgarcep
Copy link
Contributor Author

@alvaromb @TSMMark I've fixed the linting issues and the scrollToPosition error.

Copy link
Collaborator

@TSMMark TSMMark left a comment

Choose a reason for hiding this comment

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

I managed to test it in out in our codebase and it works great. Looking forward to this release

@alvaromb
Copy link
Collaborator

LGTM

@alvaromb
Copy link
Collaborator

Please give me a moment to pick up a ☕️ and I'll release this.

Many thanks!

@alvaromb
Copy link
Collaborator

@TSMMark hi Mark! Want to join as a collaborator to this repo?

@TSMMark
Copy link
Collaborator

TSMMark commented Mar 16, 2018

Sure thing!

@TSMMark
Copy link
Collaborator

TSMMark commented Mar 16, 2018

@alvaromb Thanks for the invite! Do we need to have tests written to cover this behavior? Maybe I'm missing it but I did not see any tests in the codebase, as yarn test only runs eslint.

@sebasgarcep
Copy link
Contributor Author

@TSMMark How would you test this PR? Sorry if the question sounds dumb but I don't know how one should test an UI Component.

@TSMMark
Copy link
Collaborator

TSMMark commented Mar 19, 2018

It doesn't look like this library utilizes any, but there are plenty of options such as jest, enzyme, detox, cavy.

@TSMMark
Copy link
Collaborator

TSMMark commented Mar 19, 2018

@alvaromb is there anything you would like me to do here or would you mind releasing today?

@alvaromb alvaromb merged commit 5be434e into APSL:master Mar 19, 2018
@alvaromb
Copy link
Collaborator

Released https://github.com/APSL/react-native-keyboard-aware-scroll-view/releases/tag/v0.5.0 🎉

@slorber
Copy link
Collaborator

slorber commented Jun 7, 2018

hey, just want to say I've made a separate library that was inspired by this initial implementation of @sebasgarcep

https://github.com/slorber/react-native-scroll-into-view

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.

4 participants