Focus the first input of MudBlazor dialogs opened from action menus - #25949
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts MudBlazor dialog/menu interactions so dialogs opened from “action menus” keep focus correctly by ensuring menus close before actions run, and by configuring dialogs to autofocus an appropriate element.
Changes:
- Introduces
AbpMudActionMenu/AbpMudActionMenuItemwrappers that close the menu before executing the item click handler (preventing focus from being pulled back to the menu activator). - Switches existing entity/action dropdowns and permission resource action menus to use the new wrappers.
- Updates dialog focus behavior by adding
AutoFocuson the permission search field and adjusting the feature dialog’sDefaultFocus.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/ResourcePermissionManagementModal.razor | Uses the new action menu wrappers for row actions inside the resource permissions grid. |
| modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/Components/PermissionManagementModal.razor | Adds AutoFocus to the search field to ensure the dialog receives focus. |
| modules/permission-management/src/Volo.Abp.PermissionManagement.Blazor.MudBlazor/_Imports.razor | Imports Volo.Abp.MudBlazorUI.Components to enable new component usage in the module. |
| modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.MudBlazor/Components/FeatureManagementModal.razor | Changes dialog DefaultFocus to make the dialog focus something by default. |
| framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityActions.razor | Replaces MudMenu with AbpMudActionMenu for dropdown actions and adds an aria-label. |
| framework/src/Volo.Abp.MudBlazorUI/Components/MudEntityAction.razor | Replaces MudMenuItem with AbpMudActionMenuItem for dropdown actions. |
| framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudActionMenu.razor | New wrapper component that cascades itself and forwards common MudMenu parameters. |
| framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudActionMenu.razor.cs | Implements CloseAsync() to close menus before invoking item actions. |
| framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudActionMenuItem.razor | New wrapper around MudMenuItem to control close timing. |
| framework/src/Volo.Abp.MudBlazorUI/Components/AbpMudActionMenuItem.razor.cs | Invokes ParentMenu.CloseAsync() before running OnClick. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## rel-10.7 #25949 +/- ##
=========================================
Coverage 48.58% 48.59%
=========================================
Files 3795 3795
Lines 131541 131541
Branches 9979 9979
=========================================
+ Hits 63915 63926 +11
+ Misses 65718 65702 -16
- Partials 1908 1913 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
enisn
approved these changes
Aug 11, 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.
MudBlazor restores the focus to the menu activator while closing, which ran after the dialog opened and pulled the focus out of it.
AbpMudActionMenu/AbpMudActionMenuItemclose the menu before running the action, and the dialogs declare their focus target.