microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

MenuFlyoutItem icon's foreground doesn't change back to resting color

Open eduardobragaxz opened this issue 1 year ago • 5 comments

Describe the bug

If you change the foreground of a MenuFlyoutItem and then hover over it, the color won't return for the icon once the pointer goes away.

Steps to reproduce the bug

Create a project with a MenuFlyoutItem and change it's foreground.

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.5.3: 1.5.240428000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

eduardobragaxz avatar Jun 03 '24 14:06 eduardobragaxz

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

github-actions[bot] avatar Jun 03 '24 14:06 github-actions[bot]

How are you changing the foreground on the MenuFlyoutItem? If you set the Foreground property directly on the element, this will override any values being set from style.

codendone avatar Jun 13 '24 16:06 codendone

Yeah I just change the Foreground on the MenuFlyoutItem. If I hover the mouse the text and icon will change to white/black, and when I move the mouse away only the text reverts to the color I set. The icon remains white/black.

eduardobragaxz avatar Jun 13 '24 19:06 eduardobragaxz

https://github.com/microsoft/microsoft-ui-xaml/assets/50815710/a6a1982c-794d-43b5-a732-c02bd8829b03

You can see the very fist AppBarButton that is blue works correctly, but the two MenuFlyoutItems don't.

eduardobragaxz avatar Jun 13 '24 20:06 eduardobragaxz

Thanks for clarifying!

codendone avatar Jun 14 '24 05:06 codendone

I think this is a similar root cause to #7208.

In the default template, the TextBlock has Foreground="{TemplateBinding Foreground}", however the ContentPresenter for the Icon has no Foreground set. So when transitioning away from the PointerOver state, the icon foreground does not revert back to what it was previously.

kmahone avatar Jul 15 '24 21:07 kmahone

This issue has been fixed in 1.8-stable

niels9001 avatar Sep 10 '25 12:09 niels9001