diff --git a/lib/KeyboardAwareMixin.js b/lib/KeyboardAwareMixin.js index 08a34b3..9289a2e 100644 --- a/lib/KeyboardAwareMixin.js +++ b/lib/KeyboardAwareMixin.js @@ -52,12 +52,18 @@ const KeyboardAwareMixin = { if (!currentlyFocusedField) { return } + UIManager.viewIsDescendantOf( currentlyFocusedField, this.getScrollResponder().getInnerViewNode(), (isAncestor) => { if (isAncestor) { - this.scrollToFocusedInputWithNodeHandle(currentlyFocusedField) + // Check if the TextInput will be hidden by the keyboard + UIManager.measureInWindow(currentlyFocusedField, (x, y, width, height) => { + if (y + height > frames.endCoordinates.screenY) { + this.scrollToFocusedInputWithNodeHandle(currentlyFocusedField) + } + }) } } )