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

Item occlusion/Render order #1250

Open
2 tasks done
bengy opened this issue Jun 26, 2024 · 1 comment
Open
2 tasks done

Item occlusion/Render order #1250

bengy opened this issue Jun 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bengy
Copy link

bengy commented Jun 26, 2024

Hello,
I'm running into some issues with items occluding each other if they overflow their heights.
What I'm trying to accomplish is rendering items that can be nested as shown here:
share_5168760673647972633

I would like the parent container to wrap around it's children as shown in the image in order for the click animation to be on the hole container. In the example this is done by overflowing the box for the first parent element and adding extra padding to child elements. Each element should still be it's own list item as I would like to add a filter by [all/only parents/only children] and
animate between their nested and unnested states.

Current behavior

The list is rendered correclty for the first render but when scrolling I run into render order issues with the children being occluded by the overflowing parent container. Setting the zIndex or elevation does not change the behaviour.
See the attached video (note that I switch to flatlist half through the video where the issue does not appear):

screen-20240626-094801.mp4

Expected behavior

Behave like the FlatList or ,if this is just not how it's supposed to work, this difference to the FlatList behaviour could be added to the documentation

To Reproduce

Github link to Expo repro

Platform:

  • iOS
  • Android

Environment

1.6.4

@bengy bengy added the bug Something isn't working label Jun 26, 2024
@phgn0
Copy link

phgn0 commented Aug 23, 2024

So here's what fixed click interactions with absolute overlay content for me.

<FlashList
    ...
    CellRendererComponent={(props) => (
        <View
            {...props}
            style={{
                zIndex: isActiveElement ? 10 : 1,
            }}
        >
            {props.children}
        </View>
    )}
    disableAutoLayout={true} // needed to fix CellRendererComponent
/>

See #738
Related: #1283

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants