react-native-keyboard-aware-scroll-view icon indicating copy to clipboard operation
react-native-keyboard-aware-scroll-view copied to clipboard

Resets to top of scrollview when moving from one TextInput to another

Open joelgetaction opened this issue 5 years ago • 23 comments

It seems like issue https://github.com/APSL/react-native-keyboard-aware-scroll-view/issues/82 is back. I am moving between TextInputs and when I do, KeyboardAwareScrollView jumps up to the top of the scroll view and then scrolls to the next input. Or sometimes scrolls to the next input and then jumps up to the top and then down. Setting enableResetScrollToCoords={false} doesn't help.

Latest version of RN and this module.

Any ideas how to fix? Thanks for this awesome component by the way, very useful! :-)

joelgetaction avatar Dec 11 '18 00:12 joelgetaction

Hmm, it seems to behave a lot better if I set blurOnSubmit={false} on my TextInput elements, but then they don't behave as desired if the user just taps on a single input as opposed to next-buttoning between them ... Just wanted to add this in case it might help others.

joelgetaction avatar Dec 11 '18 00:12 joelgetaction

Update: blurOnSubmit should be false for iOS and true for Android. Setting it to false on Android totally breaks the scrolling.

joelgetaction avatar Dec 11 '18 01:12 joelgetaction

Please try this on a real device, the jump to top issue is affects only to the simulator.

alvaromb avatar Dec 11 '18 08:12 alvaromb

I was trying this on a real device: an iPhone X running iOS 12.1. The jump to top issue definitely affects real devices - I can reproduce it 100% of the time ...

On Dec 11, 2018 at 12:18 AM, <Álvaro Medina Ballester (mailto:[email protected])> wrote:

Please try this on a real device, the jump to top issue is affects only to the simulator.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub (https://github.com/APSL/react-native-keyboard-aware-scroll-view/issues/329#issuecomment-446111422), or mute the thread (https://github.com/notifications/unsubscribe-auth/AmWxt3ZSay63gzT6eYth4VNd_4qfPd1Fks5u32pXgaJpZM4ZMc-F).

joelgetaction avatar Dec 11 '18 17:12 joelgetaction

I'll try to reproduce this today. Thanks for reporting.

alvaromb avatar Dec 12 '18 08:12 alvaromb

I'm unable to reproduce the issue on a real device in an app we're about to release. Can you share the source code of your component?

alvaromb avatar Dec 12 '18 15:12 alvaromb

I can’t share the source code of the actual app because it’s a private app but I could rip out the relevant components and put them in a small test app that reproduces the issue. Give me a few days to do that please and I’ll update this issue with a link to that repo when it’s done ...

On Dec 12, 2018 at 7:10 AM, <Álvaro Medina Ballester (mailto:[email protected])> wrote:

I'm unable to reproduce the issue on a real device in an app we're about to release. Can you share the source code of your component?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub (https://github.com/APSL/react-native-keyboard-aware-scroll-view/issues/329#issuecomment-446621353), or mute the thread (https://github.com/notifications/unsubscribe-auth/AmWxt_dEVoT7qfeM-cl4KNXQfoygioE4ks5u4RxugaJpZM4ZMc-F).

joelgetaction avatar Dec 12 '18 17:12 joelgetaction

Please try this on a real device, the jump to top issue is affects only to the simulator.

From the way you worded that, it sounds like it's a known issue.

Do you know why it happens in the Simulator and how to avoid it? I've got a pretty long form in my app and am getting pretty close to defenestrating my Mac :smile:

wbercx avatar Feb 08 '19 00:02 wbercx

@wbercx and @alvaromb - I definitely see this issue on a real device. It does not happen only on the simulator ...

joelgetaction avatar Feb 08 '19 00:02 joelgetaction

@wbercx and @alvaromb - I definitely see this issue on a real device. It does not happen only on the simulator ...

Yeah, just tested it on an iPad. Happens there too. enableResetScrollToCoords={false} on my KeyboardAwareFlatList has actually worked for me somewhat.

wbercx avatar Feb 08 '19 00:02 wbercx

I could fix this issue by adding keyboardOpeningTime={-1} to KeyboardAwareScrollView. Seems a little hacky but solved the problem in my case.

szilarddoro avatar Mar 19 '19 12:03 szilarddoro

seems this issue is related to https://github.com/APSL/react-native-keyboard-aware-scroll-view/issues/333 - has there been any fix implemented for this?

keyboardOpeningTime={-1} did not work enableResetScrollToCoords={false} did not work

enableAutomaticScrollwas the closest I could get to a fix but it still scrolls down slightly when the input is focused.

krisxcrash avatar Jul 23 '19 21:07 krisxcrash

This happens to me as well with the following properties set: keyboardOpeningTime={0} enableResetScrollToCoords={false} keyboardShouldPersistTaps="handled" extraScrollHeight={120}

Pressing the second input a second time, appears to work, but pressing it the first time it does bounce or scroll strangely.

talon-himself avatar May 11 '20 21:05 talon-himself

I am also running into the same exact issue. I tried all the things above with no luck. If one textinput is selected and I select the next one, it adjusts as expected, but then all of the sudden it just scrolls all the way up. Has anyone else figured out a way to fix this? This is happening on a simulated device and real device.

asoomar avatar May 15 '20 07:05 asoomar

Im also experiencing this. Have no clue how to approach it

Return-1 avatar Sep 28 '20 11:09 Return-1

keyboardOpeningTime={0} enableResetScrollToCoords={false}

worked for me

caglardurmus avatar Oct 27 '20 08:10 caglardurmus

Has anyone found a solution for this yet? Using RN 0.63.3 and react-native-keyboard-aware-scroll-view 0.9.4

Technaur avatar Aug 03 '21 14:08 Technaur

This happens to me as well with the following properties set: keyboardOpeningTime={0} enableResetScrollToCoords={false} keyboardShouldPersistTaps="handled" extraScrollHeight={120}

Pressing the second input a second time, appears to work, but pressing it the first time it does bounce or scroll strangely.

Same issue here for me, did you manage to fix this at all?

richlewis14 avatar May 09 '22 10:05 richlewis14

Getting this issue as well on real device.

achall9 avatar Jun 14 '23 22:06 achall9

Same issue happening for me, even on multiple real iOS devices. It seems current best option is the setTimeout.

L4liK0rn avatar Aug 19 '23 16:08 L4liK0rn

Just updating here. I had this issue a few weeks ago, and although I can't remember where I found the work-around, this is what works for me: keyboardOpeningTime={Number.MAX_SAFE_INTEGER}

DaltonPelkey avatar Aug 26 '23 19:08 DaltonPelkey

Just updating here. I had this issue a few weeks ago, and although I can't remember where I found the work-around, this is what works for me: keyboardOpeningTime={Number.MAX_SAFE_INTEGER}

it worked without scrolling down. Thank you very much

BuiHung1612 avatar Nov 10 '23 03:11 BuiHung1612

Just updating here. I had this issue a few weeks ago, and although I can't remember where I found the work-around, this is what works for me: keyboardOpeningTime={Number.MAX_SAFE_INTEGER}

Worked for me too. Thank you

danielfogacaa avatar Nov 23 '23 15:11 danielfogacaa