Maui icon indicating copy to clipboard operation
Maui copied to clipboard

[BUG] Popup show on unexpected window when app using multiple window

Open jingliancui opened this issue 1 year ago • 4 comments

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

There have 2 window in the app, When I want to show the popup in the second window, but the popup show on the first window.

Expected Behavior

There have 2 window in the app, When I want to show the popup in the second window, the popup should be shown on the second window.

Steps To Reproduce

  1. open the sln using vs 2022.
  2. f5 to run the app
  3. click "OpenWin" button on the first window to open the second window.
  4. click "OpenPopup" button to show the Popup

Link to public reproduction project repository

https://github.com/jingliancui/MAUIMultipleWinPopupIssue

Environment

- .NET MAUI CommunityToolkit:8
- OS:Windows 11 19041.0
- .NET MAUI: 8

Anything else?

no

jingliancui avatar Dec 21 '23 05:12 jingliancui

@jingliancui , Is the following behavior what you are expecting?

https://github.com/CommunityToolkit/Maui/assets/125236133/33dad6fb-3ce1-46f3-9a73-a4ed4bcec0d6

cat0363 avatar Dec 21 '23 09:12 cat0363

@cat0363 yes! this is what I want.

jingliancui avatar Dec 21 '23 09:12 jingliancui

@jingliancui , I created a PR, but in cases where a popup is displayed by setting a timer, the active window changes, so it does not work as intended. In cases where there is no active window, it will be displayed on the MainPage. It would be nice if we could determine which page is calling the Popup, but it seems difficult.

cat0363 avatar Dec 21 '23 09:12 cat0363

@cat0363 you are right, but I think team should take some time to consider the design for multiple windows scenario. A similar issue I also can addressed in messaging center . But I will open another new issue, Why I mentioned this is I'm not sure is there anymore tool in toolkit need to take care for multiple windows scenario.

jingliancui avatar Dec 21 '23 10:12 jingliancui