Set unloaded event to make sure popup is shown on Windows.#1932
Conversation
|
Thanks @GuidoNeele! What is the root cause of the bug? I'm not sure I understand how subscribing to an empty function helps fix a bug. |
|
Hi @brminnick, The PopupExtensions relies on It's a strange issue and I can't explain why it only happens while showing a popup the second time but it is the case at the moment. |
|
It seems strange for .NET MAUI to expect a level of symmetry in listening for both I wonder if any of the team can comment on this |
pictos
left a comment
There was a problem hiding this comment.
Not sure if we'll move forward with this workaround, but if we do this need to be fixed
src/CommunityToolkit.Maui/Views/Popup/PopupExtensions.shared.cs
Outdated
Show resolved
Hide resolved
TheCodeTraveler
left a comment
There was a problem hiding this comment.
This is certainly a strange bug, but I confirm the bug exists and that the workaround does fix it.
We'll continue to keep an eye on dotnet/maui#12970, which will allow us to remove the entire workaround if/when it is fixed.
Description of Change
This fixes an issue with MAUI 8.0.60 and later where the second Popup isn't shown because the
Page.Loadedevent isn't triggering, resulting in an unresolvedTaskCompletionSource.Linked Issues
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRAdditional information
The question is should this be added to the CommunityToolkit or be fixed in MAUI itself. At the moment Popups don't work as expected when used with 8.0.60 and higher on Windows. This fixes that issue. The code is already a workaround so adding the Unloaded events is probably not that exciting and could possibly be removed if issue dotnet/maui#12970 is fixed.