-
Notifications
You must be signed in to change notification settings - Fork 644
Implements Scroll Into View #236
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
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 haven't tested it but it looks great to me
lib/KeyboardAwareHOC.js
Outdated
|
|
||
| const getScrollPosition = options.getScrollPosition || this._defaultGetScrollPosition | ||
| const { x, y, animated } = getScrollPosition(parentLayout, childLayout, this.position) | ||
| this._container.scrollToPosition(x, y, animated) |
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.
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)|
For the record this is based on conversation in #216 |
lib/KeyboardAwareHOC.js
Outdated
| element: React.Element<*>, | ||
| options: ScrollIntoViewOptions = {} | ||
| ) => { | ||
| if (!this._rnkasv_keyboardView || !view) { |
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.
As CI pointed out, view is not defined. There are also other a few more linting issues.
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 managed to test it in out in our codebase and it works great. Looking forward to this release
|
LGTM |
|
Please give me a moment to pick up a ☕️ and I'll release this. Many thanks! |
|
@TSMMark hi Mark! Want to join as a collaborator to this repo? |
|
Sure thing! |
|
@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 |
|
@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. |
|
It doesn't look like this library utilizes any, but there are plenty of options such as jest, enzyme, detox, cavy. |
|
@alvaromb is there anything you would like me to do here or would you mind releasing today? |
|
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 |
@alvaromb @TSMMark Could you please check out if my work is correct?