diff --git a/lib/KeyboardAwareHOC.js b/lib/KeyboardAwareHOC.js index d560eaf4..30f62c9e 100644 --- a/lib/KeyboardAwareHOC.js +++ b/lib/KeyboardAwareHOC.js @@ -467,7 +467,7 @@ function KeyboardAwareHOC( return; } const { keyboardSpace, keyboardEndCoordinatesScreenY } = this.state; - const currentlyFocusedField = TextInput.State.currentlyFocusedField() + const currentlyFocusedField = findNodeHandle(TextInput.State.currentlyFocusedInput()) const responder = this.getScrollResponder() if (!currentlyFocusedField || !responder ) { return @@ -784,7 +784,7 @@ function KeyboardAwareHOC( // listenToKeyboardEvents(ScrollView); // listenToKeyboardEvents(options)(Comp); const listenToKeyboardEvents = (configOrComp: any) => { - if (typeof configOrComp === 'object') { + if (typeof configOrComp === 'object' && !configOrComp.displayName) { return (Comp: Function) => KeyboardAwareHOC(Comp, configOrComp) } else { return KeyboardAwareHOC(configOrComp)