Skip to content

Commit ea1c11b

Browse files
ljsnagyalvaromb
authored andcommitted
Apply content inset to ScrollView regardless of enableAutomaticScroll property. (APSL#280)
1 parent ea13c8c commit ea1c11b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/KeyboardAwareHOC.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,13 @@ function listenToKeyboardEvents(ScrollableComponent: React$Component) {
291291

292292
// Keyboard actions
293293
_updateKeyboardSpace = (frames: Object) => {
294+
let keyboardSpace: number = frames.endCoordinates.height + this.props.extraScrollHeight
295+
if (this.props.viewIsInsideTabBar) {
296+
keyboardSpace -= _KAM_DEFAULT_TAB_BAR_HEIGHT
297+
}
298+
this.setState({ keyboardSpace })
294299
// Automatically scroll to focused TextInput
295300
if (this.props.enableAutomaticScroll) {
296-
let keyboardSpace: number = frames.endCoordinates.height + this.props.extraScrollHeight
297-
if (this.props.viewIsInsideTabBar) {
298-
keyboardSpace -= _KAM_DEFAULT_TAB_BAR_HEIGHT
299-
}
300-
this.setState({ keyboardSpace })
301301
const currentlyFocusedField = TextInput.State.currentlyFocusedField()
302302
const responder = this.getScrollResponder()
303303
if (!currentlyFocusedField || !responder) {

0 commit comments

Comments
 (0)