[dev-v5][DataGrid] Fix FluentDataGrid not working correctly when used in Drawer/Dialog#4983
Merged
Merged
Conversation
|
✅ All tests passed successfully Details on your Workflow / Core Tests page. |
Summary - Unit Tests Code CoverageSummary
CoverageMicrosoft.FluentUI.AspNetCore.Components - 98.9%
Microsoft.FluentUI.AspNetCore.Components.Charts - 100%
Microsoft.FluentUI.AspNetCore.Components.Tests.Tools - 70.5%
|
dvoituron
requested changes
Jul 1, 2026
dvoituron
requested changes
Jul 1, 2026
dvoituron
requested changes
Jul 1, 2026
- Removed unnecessary IsDrawer check - Removed march/closest test for specific elements
….com/microsoft/fluentui-blazor into users/vnbaaij/dev-v5/fix-issue-#4562
….com/microsoft/fluentui-blazor into users/vnbaaij/dev-v5/fix-issue-#4562
- Added JS interop setup in the test constructor: -Microsoft.FluentUI.Blazor.Components.Dialog.ShouldHandleShortcut now returns true for test invocations. - Kept shortcut key dispatch on fluent-dialog (reliable for @onkeydown in bUnit). - Updated invalid shortcut path consistently.
dvoituron
approved these changes
Jul 3, 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.
Fixes #4562
Problem
When a
FluentDataGridwith header menus is hosted inside aFluentDialog/drawer, opening acolumn-header menu caused it to flash open and close instantly. Both mouse and keyboard
interaction were affected, leaving the menu unusable.
Root cause
FluentDialogused the defaultIHandleEventbehavior, which callsStateHasChangedautomatically after every event callback. The
beforetoggle/toggleandkeydowneventsthat bubble up from popover content inside the dialog (such as the DataGrid header menu) were
attributed to the dialog's own handlers via Blazor's event delegation. The resulting automatic
re-render of the entire dialog subtree recreated the grid's keyed header cells, which detached
the just-opened menu popover and closed it immediately.
Fix
FluentDialognow implementsIHandleEventto suppress the unnecessary automatic re-renderafter its event callbacks, and ignores toggle events that don't target the dialog instance. This
keeps the dialog content stable when inner popovers open, so the menu stays open and is fully
operable by mouse and keyboard.