-
Notifications
You must be signed in to change notification settings - Fork 97
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
Only scroll to view when view is hidden under keyboard #9
Comments
Having the same issue. |
I haven't worked on PR, or anything else... The solution is to determine focused element/input coordinates and compare those to keyboard's coordinates. If keyboard does not cover focused element/input, prevent scrolling. Some time ago I posted this issue on RN's issues. Take a look at |
…eyboard is not covering input. re: wix-incubator#9
@artald I didn't send a PR since I was unsure if you either would accept this feature, or would want to implement in another way. But, for others out there you can see how I made this work in the following commit shakyShane@873cca3 the usage would be <KeyboardAwareScrollView
getTextInputRefs={() => [this._ref1, this._ref2]}
scrollToInputIfNotHidden={false}
>
...
</KeyboardAwareScrollView> excuse the clunky naming - I wanted to keep the default set to true for back compat |
@shakyShane that's great, thanks! The naming indeed seems a bit confusing, but I understand regarding the backwards compatibility reasons. I would also perform a small refactor - not measure the height anyway if it's the default prop, maybe extract the actual scrolling to input to another method. You can totally go ahead and make this PR, maybe we can change some small stuff. If you prefer I can just take your commit and do it myself sometime soon. It's up to you 😀. |
Thanks for the reply. Yep I'll send a PR with your suggestions. Naming that prop though.... :p |
See the attachment. Such handling looks messy and should not happen.
The text was updated successfully, but these errors were encountered: