Skip to content

[BUG] TintColorBehavior does not work correctly within a popup control #2137

Closed

Description

@CraigBelser

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

The IconTintColorBehavior when used in a community in toolkit popup on the windows platform loses the tint color when the popup is reopened. The color will initially show up on the first use, but subsequent uses lose the tint color. Beyond the community toolkit popup that is part of the code repro, it also happens in custom dropdowns for other controls like the Telerik combo box dropdown and other third party dropdowns.

PopupTintLoss.mp4

Expected Behavior

Tint color will remain on the target control when the popup reopens.

Steps To Reproduce

  1. Open and run the attached repro
  2. press the popup button
  3. see the tint
  4. close the popup using the close button on the popup
  5. reopen the popup
  6. see the tint color loss

Link to public reproduction project repository

https://github.com/ImpySoft/TintColorIssue

Environment

- .NET MAUI CommunityToolkit: 9.0.3
- OS: Windows
- .NET MAUI: 8

Anything else?

No response

Activity

  1. cat0363 commented on Aug 21, 2024

    @cat0363
    Contributor

    @CraigBelser , Popup is not designed to reuse instances.
    After modifying it as below, it should work as intended.

        public partial class MainPage : ContentPage
        {
            private TestPopup testPopup; 
    
           public MainPage()
            {
                InitializeComponent();
            }
    
            private void OnPopupButtonClicked(object? sender, EventArgs e)
            {
                //part of this test is reusing the popup to maintain state.  Creating a new one would bypass the issue.
                testPopup = new TestPopup();            
                this.ShowPopup(testPopup);
            }
        }
    

    FYI. #1377

  2. CraigBelser commented on Aug 21, 2024

    @CraigBelser
    Author

    @cat0363 My apologies for missing that reference. However; beyond the community toolkit popup example that is part of the code repro, it also happens in custom dropdowns for other controls like the Telerik combo box dropdown and other third party dropdowns. This issue is for most other popups across windows. I will update the repro to show a couple of additional examples.

  3. locked and limited conversation to collaborators on May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/behaviorsIssue/Discussion/PR that has to do with BehaviorsbugSomething isn't workingunverified

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions