slorber / react-native-scroll-into-view

Scroll a ReactNative View into the visible screen. Similar to DOMElement.scrollIntoView() browser function.
https://thisweekinreact.com
MIT License
415 stars 13 forks source link

Warpping my form inside wrapScrollView causes my forminputs to get blurred #56

Closed davepaiva closed 1 year ago

davepaiva commented 1 year ago

I am using Formik to build my forms. First I wrapped react-native's ScrollView component like so:

  const CustomScrollView = wrapScrollView(ScrollView);

and then I proceed to wrap my entire form inside the above CustomScrollView like so:

<CustomScrollView>
// ... rest of the form code
</CustomScrollView>

As I type two letters into the first form input the input goes out of focus and the keyboard disappears. My hunch is that it tries to scroll up while typing

Note that this happens even if I don't wrap the input components inside <ScrollIntoView>

davepaiva commented 1 year ago

Okay, issue is resolved. It was a silly mistake to declare const CustomScrollView = wrapScrollView(ScrollView); inside the screen component