-
Notifications
You must be signed in to change notification settings - Fork 644
Fix leftover blank space at bottom of scrollView on android #279
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
lib/KeyboardAwareHOC.js
Outdated
|
||
_resetKeyboardSpace = () => { | ||
const keyboardSpace: number = this.props.viewIsInsideTabBar | ||
? _KAM_DEFAULT_TAB_BAR_HEIGHT + this.props.extraScrollHeight || 0 |
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.
Have you tried to set extraScrollHeight
to 0
?
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.
In fact, if you don't set extraScrollHeight
, it should have 0
value. Can you check in your code the execution of this ternary operator?
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'm feeling a bit slow here. Yes. If I set extraScrollHeight
to 0, then the keyboard space is reset to the appropriate height. But the bug is about when extraScrollHeight
isn't 0. It's a useful property and it does the right thing when the keyboard is open. When the keyboard is closed, the extra padding it provides should go away and that's what this PR is about.
lib/KeyboardAwareHOC.js
Outdated
|
||
_resetKeyboardSpace = () => { | ||
const keyboardSpace: number = this.props.viewIsInsideTabBar | ||
? _KAM_DEFAULT_TAB_BAR_HEIGHT + this.props.extraScrollHeight || 0 |
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.
In fact, if you don't set extraScrollHeight
, it should have 0
value. Can you check in your code the execution of this ternary operator?
This would be a really useful fix! Any timeline on when it will be merged? |
@alvaromb Is there any help needed to merge this PR? |
Recently we discovered a layout bug on Android where the temporary
extraScrollHeight
bottom-padding never went away after the keyboard was closed.I dove into the code and noticed that when
keyboardDidHide
(Android) is triggered,_resetKeyboardSpace
intends to reset the keyboardSpace (bottomPadding) state, but is includingextraScrollHeight
in the final calculation. That doesn't seem right, and removing it fixes our leftover padding issue after the keyboard is closed.This change doesn't seem to cause any problems on iOS.