diff --git a/lib/KeyboardAwareHOC.js b/lib/KeyboardAwareHOC.js index 4bf0ed0..710a4a0 100644 --- a/lib/KeyboardAwareHOC.js +++ b/lib/KeyboardAwareHOC.js @@ -298,18 +298,17 @@ function KeyboardAwareHOC( if (keyboardOpeningTime === undefined) { keyboardOpeningTime = this.props.keyboardOpeningTime || 0 } - setTimeout(() => { - if (!this.mountedComponent) { - return - } - const responder = this.getScrollResponder() - responder && - responder.scrollResponderScrollNativeHandleToKeyboard( - reactNode, - extraHeight, - true - ) - }, keyboardOpeningTime) + if (this.mountedComponent) { + UIManager.measureLayout( + reactNode, + 0, + () => {}, + (x, y, width, height) => { + findNodeHandle(this._rnkasv_keyboardView), (x, y, width, height) => { + this._rnkasv_keyboardView.scrollToPosition(0, parseInt(y) - height - extraHeight, true); + } + }); + } } scrollIntoView = async (