Skip to content

fix: MenuItem hover animation disappears after click#1451

Merged
pomianowski merged 1 commit intolepoco:mainfrom
jbryknar:feature/1394-MenuItem_hover_animation_disappears_after_click
Jun 16, 2025
Merged

fix: MenuItem hover animation disappears after click#1451
pomianowski merged 1 commit intolepoco:mainfrom
jbryknar:feature/1394-MenuItem_hover_animation_disappears_after_click

Conversation

@jbryknar
Copy link
Copy Markdown
Collaborator

@jbryknar jbryknar commented Jun 13, 2025

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

The MenuItem in the menu displays a smooth hover animation when the mouse pointer is over it. However, after clicking the button, the hover visual state disappears and does not return until the mouse is moved outside the item and then back onto it. This creates a temporary loss of visual feedback, which may feel inconsistent or unintuitive to users.

To reproduce this issue:

  • Open the WPF UI Gallery application.
  • Navigate to the Menu section.
  • Click on the "Bold" menu item.
  • Observe that the hover effect disappears and does not return until the mouse is moved away and back again.

Before Fix

Menu_MenuItem_HoverActions_BeforeFix

Issue Number: #1394

What is the new behavior?

The hover visual feedback now remains active while the MenuItem is pressed and the mouse is still over it. This is achieved by adding a new MultiTrigger that responds to both IsMouseOver and IsPressed properties. As a result, the hover animation no longer disappears immediately after clicking the item, providing a more consistent and intuitive user experience.

Theme Brushes for Menu and MenuItem:

SolidColorBrush Color Light Dark
MenuBarBackground SubtleFillColorTransparent #00FFFFFF #00FFFFFF
MenuBarItemBackgroundSelected SubtleFillColorSecondary #09000000 #0FFFFFFF
MenuBarItemBackgroundPressed SubtleFillColorTertiary #06000000 #0AFFFFFF
MenuBarItemBorderBrush ControlAltFillColorTertiary #0F000000 #0BFFFFFF
MenuBarItemTextForegroundPressed TextFillColorSecondary #9E000000 #C5FFFFFF

After Fix

Menu_MenuItem_HoverActions_AfterFix

Other information

N/A

@jbryknar jbryknar requested a review from pomianowski as a code owner June 13, 2025 09:19
@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. styles Topic is related to styles PR Pull request gallery WPF UI Gallery release labels Jun 13, 2025
@jbryknar jbryknar marked this pull request as draft June 13, 2025 09:20
@jbryknar jbryknar marked this pull request as ready for review June 13, 2025 09:40
@pomianowski pomianowski changed the title Fix MenuItem hover animation disappears after click fix: MenuItem hover animation disappears after click Jun 16, 2025
@pomianowski pomianowski merged commit 794979d into lepoco:main Jun 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. gallery WPF UI Gallery PR Pull request release styles Topic is related to styles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants