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

Sticky Scroll View #10

Open
mdoyle1 opened this issue Jun 25, 2020 · 0 comments
Open

Sticky Scroll View #10

mdoyle1 opened this issue Jun 25, 2020 · 0 comments

Comments

@mdoyle1
Copy link

mdoyle1 commented Jun 25, 2020

I'm getting strange scroll view behavior when using SwiftUIRefresh on multiple lists within the same view.

Check out the original code...
https://stackoverflow.com/questions/62566029/pull-to-refresh-swiftui-swiftuirefresh-sticky-scroll-view

I have a list encompassing views containing ForEach content that will populate the list depending on conditionals.
Basic idea below.

List{
if showStateArray == false {
     if showOriginalContent {
        ForEach(originalItem){content in
        Text(content)
        } else {
                   ForEach(modifiedItem){content in
                   Text(content)
                    }
    }
 if showStateArray {
    ForEach(array){item in 
    Text(item) }
    .pullToRefresh
    }

}.pullToRefresh

The problem occurs when showStateArray is true.
The ForEach content is displayed, .pullToRefresh works as expected but the scroll behavior changes.
When you scroll and lift the list stops moving immediately. It's frustrating when dealing with long lists.

If I remove .pullToRefresh from the showStateArray is true ForEach and .pullToRefresh only applied to the List{} block, .pullToRefresh works on every thing in the block except when showStateArray is true.
In this case, when showStateArray is true .pullToRefresh doesn't want to work on the list displayed.

The issue seems to be intermittent on my iPhone but constant on the iPad.
running 13.5.1 on both.

I may have overlooked something in my code but I'm not sure if any one else has had this issue or has a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant