CommunityToolkit / CommunityToolkit/Maui
[BUG] Popup V2 Sometimes Waits Indefinitely
- Dominant language
- C#
- Stars
- 2.7k
- Forks
- 500
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Did you read the "Reporting a bug" section on Contributing file?
- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
### Current Behavior
In some circumstances an `await` on `ShowPopupAsync` will wait indefinitely without showing a popup.
### Expected Behavior
The popup should show.
### Steps To Reproduce
1. Download the repository from GitHub.
2. Open, build and run the project on Windows.
You should see this (you can using the `workaround` branch):

But what you'll actually see is this (from the `main` branch:

### Link to public reproduction project repository
https://github.com/david-maw/PopupPage.git
### Environment
```markdown
- .NET MAUI CommunityToolkit: 1.2.0
- OS: Windows 11
- .NET MAUI: 9.0.80
```
### Anything else?
The failing program is in the `main` branch, there's a workaround in the `workaround` branch. The workaround is to add
``` C#
await Task.Delay(100);
```
before the `await` on `ShowPopupAsync`.
Because the workaround is trivial, this is not a significant problem for me.
Contributor guide
Research direction
Start by running the public PopupPage reproduction on Windows from its main branch and compare its behavior with the workaround branch. Trace the await on ShowPopupAsync and identify why the popup does not appear; done means the popup displays and the await completes without adding the Task.Delay(100) workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100