Skip to content

How to Capture Full ScrollView Content When Using stickyHeaderIndices with Multiple Child Elements #571

Open
@lookis

Description

@lookis

I've noticed that to capture all the content within a ScrollView, it's necessary to wrap the content inside a single View, as shown in the following examples:

    <ScrollView>
      <ViewShot>
        <Text>...The Scroll View Content Goes Here...</Text>
      </ViewShot>
    </ScrollView>

or

    <ScrollView>
      <View ref={ref}>
        <Text>...The Scroll View Content Goes Here...</Text>
      </ViewShot>
    </ScrollView>

However, I'm currently utilizing the stickyHeaderIndices property of the ScrollView, which designates specific content elements as sticky headers based on their indices in the content array:

    <ScrollView
      stickyHeaderIndices={[0]} // Refers to the first child element
    >
        <Text>...The 1st Content Goes Here...</Text>
        <Text>...The 2nd Content Goes Here...</Text>
        <Text>...The 3rd Content Goes Here...</Text>
        <Text>...The 4th Content Goes Here...</Text>
    </ScrollView>

Given this setup, how can I capture the entire content of the ScrollView, including both the sticky headers and the scrollable content?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions