1

I have a ScrollView inside another ScrollView. I noticed that I have to tap twice in order to make the nested scroll view start scrolling.

I tried using some properties like scrollEnabled, nestedScrollEnabled and keyboardShouldPersistTaps="always" but none of these helped.

I can't provide any real code because the project is quite big and there are multiple components in between the scroll views. However, the basic structure is similar to this:

<ScrollView>
  <SomeNestedComponents>
    <ScrollView
      scrollEnabled={true}
      nestedScrollEnabled={true}
      keyboardShouldPersistTaps="always"
    >
    </ScrollView>
  </SomeNestedComponents>
</ScrollView>

1 Answer 1

3

I suggest you try putting keyboardShouldPersistTaps='always' on the outermost <ScrollView /> component as well. According to the final answer in this GitHub issue, that should fix it.

For example:

<ScrollView keyboardShouldPersistTaps='always'>
  <SomeNestedComponents>
    <ScrollView
      scrollEnabled={true}
      nestedScrollEnabled={true}
      keyboardShouldPersistTaps='always'
    >
    </ScrollView>
  </SomeNestedComponents>
</ScrollView>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.