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

scrollview bounces when textinput focused #217

Closed
dswbx opened this issue Jan 26, 2018 · 18 comments
Closed

scrollview bounces when textinput focused #217

dswbx opened this issue Jan 26, 2018 · 18 comments

Comments

@dswbx
Copy link

dswbx commented Jan 26, 2018

keyboardawaremove mp4

Code:

<KeyboardAwareScrollView
    style={{backgroundColor: '#f7f7f7'}}
    enableResetScrollToCoords={false}
    keyboardOpeningTime={300}
>{/* ... */}</KeyboardAwareScrollView>

Needed to add enableResetScrollToCoords, otherwise the ScrollView would have been scrolled to top when Keyboard was dismissed interactively. Also added an higher keyboardOpeningTime, so it scrolls smoother when ScrollView actually needs to be pushed upwards.

As seen in gif above, there is no need for scrollview to be adjusted. How may I prevent this behavior?

@antsmo
Copy link

antsmo commented Feb 6, 2018

Any ETA on a fix for this? Just run into a similar issue which is probably related.

When switching focus from one input to another it bounces first

feb-06-2018 12-36-06

@mattychen
Copy link

@rssfeed I was able to get around this by removing the React Navigation Header on ios. Does that potentially work for you?

@luco
Copy link

luco commented Jul 27, 2018

Still having this issue.

@femiveys
Copy link

I have the same issue.

@avivajohnson
Copy link

I was having similar issues with the scrollview bouncing when focusing on a TextInput, and changing

<KeyboardAwareScrollView style={styles.scroll}>
to
<KeyboardAwareScrollView contentContainerStyle={styles.scroll}>

seemed to fix it for me.

@alvaromb
Copy link
Collaborator

A temporary workaround is to remove keyboardOpeningTime.

@alvaromb
Copy link
Collaborator

I'll be working on this issue this week, thanks for reporting.

@sapjax
Copy link

sapjax commented Sep 9, 2018

same issue in 0.7.2.

@sapjax
Copy link

sapjax commented Sep 9, 2018

@alvaromb I found this issue is caused by react-navigation, I add extraHeight={-64} then it works.

@kalraneeraj24550
Copy link

how to resolve this issue plz help

@MbF-Sathya
Copy link

Still having same issue!. how to solve this?

@krydos
Copy link

krydos commented Dec 5, 2018

I'm not sure how it works but negative extraHeight solved the issue for me. Thanks @sapjax. 64 is size of navigation bar?

@sapjax
Copy link

sapjax commented Dec 5, 2018

@krydos yes, it is.

@Return-1
Copy link

Return-1 commented Feb 8, 2019

Is the negative extraHeight solution the proposed one for this? I can confirm ( as per #340) that this issue still remains

@williamgrosset
Copy link

I'm using this library + react-navigation and setting extraHeight={90} with a <TextInput /> at the footer of the screen seemed to work for me (smooth scrolling with no jumps)

@arled
Copy link

arled commented Sep 9, 2019

The same happens with KeyboardAvoidingView but above solution do not work.

@iway1
Copy link

iway1 commented May 20, 2022

Still broken in 2022. One workaround is to set multiline={true} and blurOnSubmit={true}.

If you want to try the negative extra height solution, use the useHeaderHeight hook from @react-navigation/native, since it always has the correct header height.

Also note that the extraHeight solution will cause the library to no longer work with multiline inputs.

No idea how something like this gets marked as closed tbh it's a bug that's never been fixed

@rcfrias
Copy link

rcfrias commented Aug 9, 2022

As @alvaromb mentioned, the final solution to this is:
keyboardOpeningTime={0}

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

No branches or pull requests