React-native-keyboard-aware-scroll-view: screen bouncing while focusing on of the input

Created on 20 Jan 2020  路  13Comments  路  Source: APSL/react-native-keyboard-aware-scroll-view

Screen is bouncing up and down when jumping to any text input

Most helpful comment

I managed to solve it by setting keyboardOpeningTime={Number.MAX_SAFE_INTEGER}, but it's just a workaround.

All 13 comments

I'm having the same problem

have you got scrollEnabled={false} on the input? I took it off and it's working better

@louisholley well that should work but i need scroll enabled, so can't turn it off

Try replacing

setTimeout(() => {
  if (!this.mountedComponent) {
    return
  }
  const responder = this.getScrollResponder()
  responder &&
    responder.scrollResponderScrollNativeHandleToKeyboard(
      reactNode,
      extraHeight,
      true
    )
}, keyboardOpeningTime)

with

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);
    }
  });
}

inside KeyboardAwareHOC.scrollToFocusedInput()

@thijs-qv solution worked for me, thank you!

Thanks @thijs-qv. Has a PR been submitted for this?

I've just submitted a PR. Not sure if this library is actively maintained though.

I managed to solve it by setting keyboardOpeningTime={Number.MAX_SAFE_INTEGER}, but it's just a workaround.

I managed to solve it by setting keyboardOpeningTime={Number.MAX_SAFE_INTEGER}, but it's just a workaround.

Thank you very much, you saved my day

I managed to solve it by setting keyboardOpeningTime={Number.MAX_SAFE_INTEGER}, but it's just a workaround.

Solved! Thanks

 <KeyboardAwareScrollView
      scrollEnabled={true}
      extraScrollHeight={-64}
      keyboardShouldPersistTaps="handled"
      enableAutoAutomaticScroll={false}
      enableOnAndroid={true}
      keyboardOpeningTime={Number.MAX_SAFE_INTEGER}
      {...props}>
      {props.children}
</KeyboardAwareScrollView>

it is work for me

I managed to solve it by setting keyboardOpeningTime={Number.MAX_SAFE_INTEGER}, but it's just a workaround.

You saved our lives. Me and my pair friend spent a week for keyboards problems of react-native. We replaced the component for android problem but in IOS we spent too many for bouncing problem. God bless you! 馃殌 :godmode:

I managed to solve it by setting keyboardOpeningTime={Number.MAX_SAFE_INTEGER}, but it's just a workaround.

This also solved it for me. I'd like to know what the root cause is though and how to avoid it though.

Was this page helpful?
0 / 5 - 0 ratings