- 
                Notifications
    
You must be signed in to change notification settings  - Fork 463
 
Description
Is there an existing issue for this?
- I have searched the existing issues
 
Did you read the "Reporting a bug" section on Contributing file?
- 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
To simplify, picture a simple popup (with the popup V2 implementation) with a single button in it, used to close the popup.
When running my app on Windows and opening the popup, the popup seem to work just fine. However, when closing the popup, and re-opening it, the button appears to be stuck in the "Pressed" VisualState. Clicking on it then calls the command as expected, but the button doesn't have the correct appearance.
A Gif video showing the issue :
Expected Behavior
When reopening the popup, the button should be using the "Normal" VisualState instead of "Pressed".
Steps To Reproduce
- Open and run the solution from the reproduction repository
 - Open the popup, and close it by clicking on the "Close" button
 - Open the popup again : the button uses the wrong VisualState.
(4. There is actually a trick to "reset" the button : click and hold on the button, then get the mouse pointer out of the clickable zone. Somehow it resets it.) 
Link to public reproduction project repository
https://github.com/gchapeaux/Sandbox_Popup
Environment
- .NET MAUI CommunityToolkit: 12.2.0
- OS: Windows 11 Professionnal
- .NET MAUI: Maui 9.0Anything else?
I tried an unsuccessful workaround, but still worth sharing : I wanted to manually update the button's VisualState through its OnClicked event. However, with this tentative, the button appears at first in the correct VisualState, but once mouseovered it goes back to the "Pressed" state.
EDIT : a workaround suggested by @bijington : declare the popup as Transient instead of Singleton
