Skip to content

Commit

Permalink
v0.1.2 with ancestor_check
Browse files Browse the repository at this point in the history
- Change method name "viewIsAncestorOf" as "viewIsDescendantOf" according to PR facebook/react-native#7876
  • Loading branch information
joseph kim committed Jun 28, 2016
1 parent ecbdfd7 commit da27a8c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/KeyboardAwareMixin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* @flow */

import { PropTypes } from 'react'
import ReactNative, { TextInput, Keyboard } from 'react-native'
import ReactNative, { TextInput, Keyboard, UIManager } from 'react-native'
import TimerMixin from 'react-timer-mixin'

const _KAM_DEFAULT_TAB_BAR_HEIGHT = 49
Expand Down Expand Up @@ -53,7 +53,15 @@ const KeyboardAwareMixin = {
return
}
try {
this.scrollToFocusedInputWithNodeHandle(currentlyFocusedField)
UIManager.viewIsDescendantOf(
currentlyFocusedField,
this.getScrollHandle().getScrollResponder().getInnerViewNode(),
(isAncestor) => {
if (isAncestor) {
this.scrollToFocusedInputWithNodeHandle(currentlyFocusedField)
}
}
)
} catch (e) {

}
Expand Down

0 comments on commit da27a8c

Please sign in to comment.