Skip to content

Commit

Permalink
bugfix ios scroll
Browse files Browse the repository at this point in the history
copied fix from APSL#426
  • Loading branch information
umob-developer authored May 27, 2024
1 parent 9eee405 commit b6648fc
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions lib/KeyboardAwareHOC.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,18 +318,33 @@ function KeyboardAwareHOC(
if (keyboardOpeningTime === undefined) {
keyboardOpeningTime = this.props.keyboardOpeningTime || 0
}
setTimeout(() => {
if (!this.mountedComponent) {
return
}
const responder = this.getScrollResponder()
responder &&
responder.scrollResponderScrollNativeHandleToKeyboard(
if(keyboardOpeningTime > 0) {
setTimeout(() => {
if (!this.mountedComponent) {
return
}
const responder = this.getScrollResponder()
responder &&
responder.scrollResponderScrollNativeHandleToKeyboard(
reactNode,
extraHeight,
true
)
}, keyboardOpeningTime)
} else {
// fix from https://github.com/APSL/react-native-keyboard-aware-scroll-view/pull/426
if (this.mountedComponent) {
UIManager.measureLayout(
reactNode,
extraHeight,
true
)
}, keyboardOpeningTime)
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 (
Expand Down

0 comments on commit b6648fc

Please sign in to comment.