Skip to content

Conversation

mikelovesrobots
Copy link
Contributor

@mikelovesrobots mikelovesrobots commented Jul 10, 2018

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 including extraScrollHeight 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.


_resetKeyboardSpace = () => {
const keyboardSpace: number = this.props.viewIsInsideTabBar
? _KAM_DEFAULT_TAB_BAR_HEIGHT + this.props.extraScrollHeight || 0
Copy link
Collaborator

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?

Copy link
Collaborator

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?

Copy link
Contributor Author

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.


_resetKeyboardSpace = () => {
const keyboardSpace: number = this.props.viewIsInsideTabBar
? _KAM_DEFAULT_TAB_BAR_HEIGHT + this.props.extraScrollHeight || 0
Copy link
Collaborator

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?

@todorone
Copy link

This bug affects iOS also - #289
@alvaromb Any comments on how this PR can be merged?

@alvaromb
Copy link
Collaborator

@todorone does this PR solves #289?

@EQuimper
Copy link

Just test this pr and look like that fix the issue
aug-24-2018 12-40-18

@clfristoe
Copy link

This would be a really useful fix! Any timeline on when it will be merged?

@todorone
Copy link

@alvaromb Sorry for the late reply. Yes, current PR fixes this problem on both iOS & Android and solves #289. It would be amazing if we can have it merged.

@todorone
Copy link

@alvaromb Is there any help needed to merge this PR?

@alvaromb alvaromb merged commit 50cd5e2 into APSL:master Oct 18, 2018
@alvaromb
Copy link
Collaborator

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.

5 participants