Skip to content

MudMenu: Remove IActivatable#10480

Closed
ScarletKuro wants to merge 1 commit intoMudBlazor:devfrom
ScarletKuro:menu_activator
Closed

MudMenu: Remove IActivatable#10480
ScarletKuro wants to merge 1 commit intoMudBlazor:devfrom
ScarletKuro:menu_activator

Conversation

@ScarletKuro
Copy link
Member

@ScarletKuro ScarletKuro commented Dec 19, 2024

Description

Fixes: #9800
WIP

How Has This Been Tested?

WIP

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added the breaking change This change will require consumer code updates label Dec 19, 2024
@ScarletKuro
Copy link
Member Author

Currently a work in progress. Not all ActivatorContent has been inspected and replaced where necessary.
Additionally, the documentation should be expanded.
If the ActivationEvent is RightClick or MouseOver, calling context.OpenMenuAsync is not necessary, as these events are handled differently.

@sonarqubecloud
Copy link

@ScarletKuro
Copy link
Member Author

If the ActivationEvent is RightClick or MouseOver, calling context.OpenMenuAsync is not necessary, as these events are handled differently.

Small update:

@danielchalmers
MouseOver has special behavior in that it also supports onclick (not specifically left or right), i dont know if that's relevant
Hover opens it temporarily but Click opens it permanently

This means that you actually do need to call context.OpenMenuAsync or context.ToggleMenuAsync (depending on the behavior we want to achieve) when the ActivationEvent is MouseOver.

There are a few open topics:

  1. Currently, on desktop, the behavior is such that if you hover over and click on the activation area while the mouse is hovering over it, the menu will toggle (close). If you click again on the activation area, the menu will open permanently, and you can hover out without it closing. The question is: should we change this behavior? Specifically, should we make it so that on non-touch devices, when you hover and click on the activation area, the menu will not toggle (close) but instead instantly activate the permanent mode?

  2. Should we create a specially named method, such as context.OpenMouseOverMenuAsync? This would allow us to properly document what it does, making it less confusing for the end user to understand which context action to use.

@danielchalmers
Copy link
Member

danielchalmers commented Dec 19, 2024

The transient flag on OpenMenuAsync is what decides if it should stay open permanently or not. By default it's false and permanent, but if's true (set during the pointerenter handler) it closes if the pointer leaves.

@github-actions

This comment was marked as off-topic.

@github-actions github-actions bot added the stale Issue or PR has had no activity and is subject to automatic closure if not updated label Jul 18, 2025
@danielchalmers danielchalmers removed the stale Issue or PR has had no activity and is subject to automatic closure if not updated label Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudMenu not closing on CloseMenuAsync

2 participants