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

When LazyPop is canceled, other actions in the view are disabled. #3

Open
keremcesme opened this issue Dec 24, 2020 · 17 comments
Open

Comments

@keremcesme
Copy link

Hello there is a look like the following. LazyPop is active. The problem is as follows: The user can come back to the previous view by sliding from anywhere on the screen. But if the user gives up and cancels lazypop, the view locks. My "Test 2" button becomes unclickable. How can I solve this?

        Button(action: {
            // Actions:
            self.mode.wrappedValue.dismiss()
        }, label: {
            Text("Test 2")
        })
    }
    .lazyPop()
    .navigationBarHidden(true)
    .navigationBarBackButtonHidden(true)
    
}
@joehinkle11
Copy link
Owner

Very odd, I would have to try it myself. Have you tried changing the order of the modifiers?

@buluoray
Copy link

buluoray commented Apr 1, 2021

I have the same issue

@joehinkle11
Copy link
Owner

Sounds like lazy pop would be too dangerous to use if it locks up UIs. If anyone finds the underlying problem, please comment here or make a PR. If I find free time I'll look into it myself

@bougieL
Copy link

bougieL commented Sep 7, 2021

Same issue

@whereiswhere
Copy link

I think I found out what's the problem is.

In my case, the culprit is the .ignoresSafeArea() modifier, if you add .ignoresSafeArea() modifier after the .lazyPop(), if would make UI locks, after remove the .ignoresSafeArea(), it won't lock anymore.

@joehinkle11
Copy link
Owner

That's interesting. Can anyone else confirm this? We could add a warning in the readme about this

@ssadel
Copy link

ssadel commented Aug 11, 2022

I found that when removing .ignoresSafeArea(), my view is still locked, but only momentarily. I can still scroll in a ScrollView, but I can't tap any buttons

@joehinkle11
Copy link
Owner

Ok thank you. I'll update the readme with a gotcha about .ignoresSafeArea(). @ssadel if you find what else is causing the bug to happen in your code, then I can add another gotcha to the readme.

I'll leave the issue open until a proper workaround is found.

@krispykalsi
Copy link

Found an interesting behaviour.

fromView - the view that is about to be popped but is cancelled by the user

  1. If the fromView contains any text fields, they will not be affected by the cancellation
  2. After tapping any one of them, all the buttons also start working as expected

@gaohomway
Copy link

gaohomway commented Apr 27, 2023

I found that when removing .ignoresSafeArea(), my view is still locked, but only momentarily. I can still scroll in a ScrollView, but I can't tap any buttons

did you solve the problem

@AndrewSB
Copy link

interestingly enough, i've come across this issue while using https://github.com/AndrewSB/SwipeTransition/tree/spm in a UIHostingController, quite similarly to how this library is implemented.

the fact that you're seeing the same issue with buttons become inactive makes me think its a limitation of SwiftUI somehow

@gaohomway
Copy link

@AndrewSB This problem still exists, do you have a solution?

@AndrewSB
Copy link

nope, i'm looking for a way to get around this too

@gaohomway
Copy link

There is another question, how to handle side sliding gestures in Page?

@AndrewSB
Copy link

the solution in SwipeTransition does it, go check out the UIGestureDelegate in it; it tells the gesture recognized to not begin if the view receiving the touch is a UIPage

@gaohomway
Copy link

Can you give the key code, thank you very much

If the Page gesture is detected, why not keep the original side swipe gesture, why choose not to work? The user cannot close the page

@ejbills
Copy link

ejbills commented Jul 10, 2023

is there any way to fix this ATM?

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

10 participants