Changed to call Popup's MapOnClosed method #2202
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, by applying PR #2166, we resolve the issue where Popup is not closed when the Close or CloseAsync method is called.
Description of Change
I added the following code to PR #2166.
[src\CommunityToolkit.Maui\HandlerImplementation\Popup\Popup.shared.cs]
The above code will no longer call the following method.
[src\CommunityToolkit.Maui.Core\Handlers\Popup\PopupHandler.macios.cs]
Since the above method is no longer called, the Popup will continue to wait.
Modify the code as below so that the MapOnClosed method is called.
[src\CommunityToolkit.Maui\HandlerImplementation\Popup\Popup.macios.cs]
Also, remove the MapOnClosed definition from PopupHandler's PopUpCommandMapper only for iOS and MacCatalyst.
PR #2166 lacked this consideration.
[src\CommunityToolkit.Maui.Core\Handlers\Popup\PopupHandler.shared.cs]
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information
The verification results are shown below.
[Case to call Close method]
iPhone.15.iOS.17.0.2024-09-12.11-12-47.mp4
[Case to call CloseAsync method]
iPhone.15.iOS.17.0.2024-09-12.11-13-09.mp4
You can see that the Popup is closed in both cases.
Below are the verification results for Issue #2149.
[Case of tapping outside of Popup]
iPhone.15.iOS.17.0.2024-09-12.11-26-17.mp4
[Case of intentionally calling the close method]
iPhone.15.iOS.17.0.2024-09-12.11-30-07.mp4
In both cases, you can see that Issue #2149 is resolved.