Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screen bouncing while focusing on of the input #418

Open
ganesh-papola opened this issue Jan 20, 2020 · 25 comments · May be fixed by #426
Open

screen bouncing while focusing on of the input #418

ganesh-papola opened this issue Jan 20, 2020 · 25 comments · May be fixed by #426

Comments

@ganesh-papola
Copy link

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

@jpamarohorta
Copy link

I'm having the same problem

@louisholley
Copy link

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

@ganesh-papola
Copy link
Author

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

@thijs-qv
Copy link

thijs-qv commented Apr 8, 2020

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()

@peterson79
Copy link

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

@steve228uk
Copy link

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

@thijs-qv thijs-qv linked a pull request Apr 16, 2020 that will close this issue
@thijs-qv
Copy link

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

@JoseLion
Copy link

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

@ntk0104
Copy link

ntk0104 commented Jul 15, 2020

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

@serhiimahdiuk
Copy link

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

Solved! Thanks

@cihanbas
Copy link

 <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

@keremcubuk
Copy link

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:

@mgwedd
Copy link

mgwedd commented Mar 15, 2021

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.

@biz-kevin
Copy link

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

WORKING :)

@anhkieet
Copy link

anhkieet commented Mar 8, 2022

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

Working, you saved my day

@luchozamora
Copy link

luchozamora commented Mar 9, 2022

For those of you wondering (just like me):
Number.MAX_SAFE_INTEGER is defined as 2^53 - 1, that is, 9007199254740991

The keyboardOpeningTime prop receives a number as miliseconds, so setting
keyboardOpeningTime={Number.MAX_SAFE_INTEGER}
actually means:

  • 9007199254741 seconds
  • 150119987579 minutes
  • 2501999793 hours
  • 104249991 days
  • 3425051 months
  • 285421 years

So yea... that

@sandipndev
Copy link

Although If you set an extraHeight , this issue goes away

@Pat-Gekoski
Copy link

@JoseLion You should run for president! The world owes you for that fix!

@vjoby-wavefin
Copy link

@JoseLion You sir you have my respect, thanks for the workaround 👍

@heyalexchoi
Copy link

heyalexchoi commented Aug 8, 2022

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

this just makes the view not scroll for me... as in the view doesn't avoid the keyboard...
I had scrollEnabled set to false. setting that to true did improve the behavior.

@scott-dang
Copy link

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

I was about to go bald, thanks!

@ahsanbhatti98
Copy link

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

After applying so many things it works finally Thanks 😊 🙏 . But can you explain how it works??

@nibinb
Copy link

nibinb commented Jul 1, 2023

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

Wow! Thanks a bunch my superhero!

@pkayokay
Copy link

pkayokay commented Aug 30, 2023

keyboardOpeningTime={Number.MAX_SAFE_INTEGER} 🙇

@MasonTModea
Copy link

enableAutomaticScroll={Platform.OS === 'ios'} worked for me, keyboardOpeningTime={Number.MAX_SAFE_INTEGER} didn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.