Remove Popup and ContentPage from LogicalChildren when Popup is closed on iOS#2166
Merged
Conversation
NeilMalcolm
reviewed
Sep 3, 2024
Contributor
Author
|
@bijington , I found that the following code causes a problem in which Popup does not close when calling the CloseAsync or Close method of the Popup class. [src\CommunityToolkit.Maui\HandlerImplementation\Popup\Popup.shared.cs] The above code prevents the following methods from being called. [src\CommunityToolkit.Maui.Core\Handlers\Popup\PopupHandler.macios.cs] I'm currently looking into how to fix it. |
This was referenced Sep 12, 2024
Contributor
Author
|
@bijington , I have created a new PR #2202. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR resolves the issue where Popup and Content Page are not removed from LogicalChildren after closing Popup on iOS.
Description of Change
To accomplish this, first add MapOnClosed to the ControlPopUpCommandMapper.
[src\CommunityToolkit.Maui\HandlerImplementation\Popup\Popup.shared.cs]
Next, within the MapOnClosed method, remove Popup and ContentPage from LogicalChildren.
[src\CommunityToolkit.Maui\HandlerImplementation\Popup\Popup.macios.cs]
Since Popup and ContentPage are stacked in LogicalChildren, remove the Popup and ContentPage added to LogicalChildren when the Popup was displayed last.
This will remove Popups and ContentPages from LogicalChildren in the order that Popups are closed.
Linked Issues
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRAdditional information
Below are the verification results.
For verification, I used the reproduction code of Issue #2149.
iPhone.15.iOS.17.0.2024-09-03.20-36-10.mp4
You can see that Popup and ContentPage are removed from LogicalChildren.
Next, I verified a pattern that displays popups hierarchically.
iPhone.15.iOS.17.0.2024-09-03.20-49-09.mp4
Similarly, you can see that Popup and ContentPage have been removed from LogicalChildren.