fix(ContextMenu): make ContextMenu work on wasm/maui#7504
Merged
Conversation
Co-Authored-By: Marcel Peereboom <40403094+peereflits@users.noreply.github.com>
Contributor
Reviewer's GuideRefactors the bundled floating-ui DOM/core modules to use shared utility ESM modules and updated platform logic, adds the missing floating-ui utils files, and adjusts the ContextMenu trigger and JS behavior to be compatible with Blazor WASM/MAUI and IL trimming. Sequence diagram for ContextMenu show behavior with async Popper creationsequenceDiagram
actor User
participant Blazor as Blazor_ContextMenuTrigger
participant JS as ContextMenu_js
participant Data as ContextMenu_DataStore
participant Popper as floating_ui_dom
User->>Blazor: Right-click (MouseEventArgs)
Blazor->>JS: show(id, event)
JS->>JS: setTimeout(0)
Note over JS: Call is deferred to next tick
JS->>Data: Data.get(id)
alt ContextMenu_found
Data-->>JS: cm
JS->>JS: el = cm.el, zone = cm.zone
JS->>JS: document.body.appendChild(el)
alt existing_popper
JS->>JS: cm.popper()
end
JS->>Popper: createPopper(zone, el, callback)
Popper-->>JS: popperCleanup
JS->>JS: cm.popper = popperCleanup
else ContextMenu_missing
Data-->>JS: null
JS-->>Blazor: no-op
end
Class diagram for ContextMenuTrigger and MouseEventArgs trimming dependencyclassDiagram
class ContextMenuTrigger {
+ContextMenuZone ContextMenuZone
+Task OnContextMenu(MouseEventArgs args)
}
class MouseEventArgs {
<<from_Microsoft_AspNetCore_Components_Web>>
%% Public methods preserved via DynamicDependency
}
class DynamicDependencyAttribute {
+DynamicDependencyAttribute(DynamicallyAccessedMemberTypes memberTypes, Type type)
}
class DynamicallyAccessedMemberTypes {
<<enum>>
PublicMethods
}
ContextMenuTrigger --> MouseEventArgs : uses_in_OnContextMenu
ContextMenuTrigger ..> DynamicDependencyAttribute : decorated_with
DynamicDependencyAttribute --> DynamicallyAccessedMemberTypes
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7504 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 748 748
Lines 32986 32986
Branches 4584 4584
=========================================
Hits 32986 32986
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This was referenced Jan 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #7450
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Update floating-ui DOM and core ESM bundles to the latest upstream utilities, adjust ContextMenu JavaScript to defer popper creation for WebAssembly/MAUI compatibility, and ensure context menu trigger reflection metadata for MouseEventArgs is preserved for trimming.
New Features:
Bug Fixes:
Enhancements: