Skip to content

Focus the first input of MudBlazor dialogs opened from action menus - #25949

Merged
enisn merged 3 commits into
rel-10.7from
maliming/mudblazor-dialog-autofocus
Aug 11, 2026
Merged

Focus the first input of MudBlazor dialogs opened from action menus#25949
enisn merged 3 commits into
rel-10.7from
maliming/mudblazor-dialog-autofocus

Conversation

@maliming

Copy link
Copy Markdown
Member

MudBlazor restores the focus to the menu activator while closing, which ran after the dialog opened and pulled the focus out of it. AbpMudActionMenu / AbpMudActionMenuItem close the menu before running the action, and the dialogs declare their focus target.

Copilot AI lite review requested due to automatic review settings August 10, 2026 08:53

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.

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 / AbpMudActionMenuItem wrappers 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 AutoFocus on the permission search field and adjusting the feature dialog’s DefaultFocus.

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.

@maliming maliming added this to the 10.7-final milestone Aug 10, 2026
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.59%. Comparing base (bafe970) to head (6a525aa).
⚠️ Report is 2 commits behind head on rel-10.7.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maliming
maliming requested a review from enisn August 11, 2026 02:47
@enisn
enisn merged commit b822e16 into rel-10.7 Aug 11, 2026
4 checks passed
@enisn
enisn deleted the maliming/mudblazor-dialog-autofocus branch August 11, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants