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

Long lists not lazily loaded #121

Open
meruiden opened this issue Mar 6, 2023 · 2 comments
Open

Long lists not lazily loaded #121

meruiden opened this issue Mar 6, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@meruiden
Copy link

meruiden commented Mar 6, 2023

Describe the bug
When using LazyVStack or ForEach, all content gets loaded immediately instead of when they become visible. I can get it to work with a List, but since that doesn't work with enableAppleScrollBehavior, the content scrolls before the list is expanded, completely breaking the scroll effect where the bottom sheet first expands before the content scrolls, so the user would have to use the little anchor to manually expand the sheet.

Minimal reproduce-able code
create a bottom sheet with 3 states and enableAppleScrollBehavior enabled.

contentView:

LazyVStack(alignment: .leading) {
    ForEach(items, id: \.id) { item in
        Text(item.name)
            .onAppear {
                print("Appeared: \(item.id")
            }
    }
}

Expected behavior
The content in LazyVStack to call onAppear only when it becomes visible

Target version

  • Environment: iOS iPhone 14 pro max simulator
  • Version: iOS 16.1 with project targeting iOS 14.0
@lucaszischka lucaszischka added the bug Something isn't working label Jun 26, 2023
@lucaszischka lucaszischka added the help wanted Extra attention is needed label Aug 29, 2023
@said13
Copy link

said13 commented Feb 14, 2024

Good point. I'm facing the same issue. Did anyone find the solution?

@alexchernokun
Copy link

@lucaszischka Hello, any updates on this issue? Thanks!

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

No branches or pull requests

4 participants