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

[BUG] Dismissing a popup also dismisses modal parent on iOS #1443

Closed
2 tasks done
matt-goldman opened this issue Oct 4, 2023 · 7 comments
Closed
2 tasks done

[BUG] Dismissing a popup also dismisses modal parent on iOS #1443

matt-goldman opened this issue Oct 4, 2023 · 7 comments
Labels
bug Something isn't working unverified

Comments

@matt-goldman
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

If you open a popup from a modal page, the modal page is popped when the popup is closed (either by calling Close() or by tapping out).

This causes some pretty significant knock-on effects; in the sample I'm attaching, for example, you can't then re-open the modal page. In a real-world app I'm working on, this has some other painful consequences.

Expected Behavior

When a popup is opened from a modal page, only the popup should disappear when dismissing or closing the popup.

Steps To Reproduce

  1. Open and run solution from sample repository
  2. Build and run on iOS
  3. Click the show modal button
  4. Click the show popup button
  5. Observe the modal page disappear as well as the popup
  6. Try to open the modal page again

Link to public reproduction project repository

https://github.com/matt-goldman/MCT-popup-issue-demo

Environment

- .NET MAUI CommunityToolkit: 6
- OS: 16
- .NET MAUI: 8 RC 1.9171

Anything else?

I have found a partial workaround, which is to call Navigation.PopModalAsync() directly rather than using the popup methods (eg, override OnDismissedByTappingOutSideOfPopup or use PopModalAsync instead of Close). This still has the same result - the popup is dismissed as well as the modal - but it does however prevent the aforementioned knock-on effects. In the sample, I have commented out this workaround, it's in the Popups/PopupPage.xaml.cs file. If you uncomment this you can see the difference in behaviour.

I've also added some logging in MainPage which proves the button click event is registered.

I suspect this may be related to #1347 (in fact I'm sure it is) but I can't quite connect the dots.

@matt-goldman matt-goldman added bug Something isn't working unverified labels Oct 4, 2023
@cat0363
Copy link
Contributor

cat0363 commented Oct 4, 2023

This is a bug caused by applying PR #1409. This bug has been fixed in PR #1361.
PR #1361 has not been released yet. This issue has been fixed in the latest version of main.

@cat0363
Copy link
Contributor

cat0363 commented Oct 4, 2023

Issue #1347 is scheduled to be resolved in PR #1369, but the discussion has stalled.

@matt-goldman
Copy link
Author

I think I may have been wrong in my original assessment. In my demo/sample app (linked), behaviour is the same whether tapping out or calling Close. In my real world app, it only happens when tapping out; calling Close does not cause the issue and works as expected. Same version.

@cat0363
Copy link
Contributor

cat0363 commented Oct 5, 2023

@matt-goldman , Is the behavior you expect below?

iPhone.14.iOS.16.4.2023-10-05.17-27-50.mp4

This requires both PR #1361 and PR #1369 fixes to be merged into main.

@matt-goldman
Copy link
Author

@cat0363 yes that looks like what I expect. Good to know, thanks - I'll keep an eye out for those PRs :)

@acaliaro
Copy link

Hi, when will be released the new version? I have updated to "6" and I have problems on iOS with the popup

@cat0363
Copy link
Contributor

cat0363 commented Nov 5, 2023

This issue was resolved in version 6.1.0.

[Version 6.1.0]

iPhone.14.iOS.16.4.2023-11-06.08-33-57.mp4

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

No branches or pull requests

4 participants