Skip to content

Commit

Permalink
Check if there is a focused field before trying to scroll to it
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaromb committed Jun 2, 2016
1 parent 0870c8d commit 97fc6a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/KeyboardAwareMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const KeyboardAwareMixin = {
})
// Automatically scroll to focused TextInput
const currentlyFocusedField = TextInput.State.currentlyFocusedField()
if (!currentlyFocusedField) {
return
}
UIManager.viewIsAncestorOf(
currentlyFocusedField,
this.getScrollHandle().getScrollResponder().getInnerViewNode(),
Expand Down

0 comments on commit 97fc6a6

Please sign in to comment.