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

shouldDismissOnTapOutside (and swipe) does not work in all situations #162

Open
sabiland opened this issue Jul 15, 2018 · 2 comments
Open

Comments

@sabiland
Copy link

If you tap (or swipe) outside popup - BUT over/on existing UI control (UIButton, etc.)

shouldDismissOnTapOutside
shouldDismissOnSwipeOutside

does not work. It would really be helpful to cover this. It is difficult otherwise (complex UI, many UI controls) to cover all those situations and hide popup manually.

@andreamazz
Copy link
Owner

I see your point.
This is going to be annoying, I'd have to resort to adding an invisible overlay to the container view, which is not a stellar solution. If anyone else is aware of a better solution that involves just the current gesture recognizer, that'd be swell.

@gpambrozio
Copy link

I had the same problem and tried adding a UIPanGestureRecognizer to the view. This recognizer is a good candidate because it would send an event early on even if you don't really pan and you can already dismiss in this situation. But it does not work if the view you're adding on top of is a scrollable view for example. So to solve my problem I added a transparent overlay to the view I want to have the popover on and add this recognizer to that view. Then I remove the view as part of the dismissHandler That's the only way I could see to solve this.

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

3 participants