Skip to content

MudFabMenu: Stop disabled menu opening on hover - #13909

Merged
danielchalmers merged 3 commits into
devfrom
fabmenu-disabled-hover
Sep 24, 2026
Merged

danielchalmers merged 3 commits into
devfrom
fabmenu-disabled-hover

Conversation

@danielchalmers

@danielchalmers danielchalmers commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

With OpenOnMouseHover on (the default), a disabled MudFabMenu opened on hover and showed its items, although clicking it did nothing.

  • Hover no longer opens or closes the menu while GetDisabledState() is true, so a cascaded ParentDisabled counts too.
  • A menu that becomes disabled while open now closes and raises OpenChanged(false). Its button can't toggle it once disabled, so without hover (or on touch) it would otherwise stay open with clickable items. This also means Open="true" together with Disabled="true" renders closed.
  • Touch needs no change: tapping opens through the inner MudFab's click, which is already blocked when disabled.

Tests cover hover, hover under a cascaded ParentDisabled, and becoming disabled while open. The hover and close tests fail without the fix.

@danielchalmers danielchalmers added the bug Unexpected behavior or functionality not working as intended label Sep 24, 2026
Hovering a disabled menu opened it and showed its items, even though clicking it did nothing.
Hover now checks GetDisabledState(), so a cascaded ParentDisabled counts too.
A menu that becomes disabled while open now closes, since its button can no longer toggle it.
@danielchalmers
danielchalmers requested a balanced review from Copilot September 24, 2026 14:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Add direct first-render coverage for Open="true" with Disabled="true".

Review effort: Lite
Findings: None

Parameter change handlers run after OnParametersSetAsync, so the Open handler reapplied the close icon after the disabled menu had already closed.
The handler now follows the current open state.
@danielchalmers
danielchalmers merged commit 47584cb into dev Sep 24, 2026
9 checks passed
@danielchalmers
danielchalmers deleted the fabmenu-disabled-hover branch September 24, 2026 15:06
@danielchalmers

Copy link
Copy Markdown
Member Author

This was discovered during #13908

This was referenced Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants