FluentNavItem in hamburger drawer triggers duplicate navigation and breaks NavigationLock confirmation
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Start by reading FluentNavItem.OnClickHandlerAsync, which the issue identifies as closing the hamburger drawer and calling NavigationManager.NavigateTo(Href) while the item also renders as a link. Reproduce the two NavigationLock callbacks with deferred navigation and an open drawer, then trace how the link and drawer click handlers interact. Done means one navigation request reaches the confirmation callback, with OK navigating and Cancel keeping the current page open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🐛 Bug Report
FluentNavItem inside an open FluentLayoutHamburger drawer appears to trigger navigation twice. This prevents an unsaved-changes confirmation using Blazor's NavigationLock from reliably allowing navigation when the user selects primary.
💻 Repro or Code Sample
- Configure a
FluentLayoutwithNavigationDeferredLoading="true". - Add a
FluentLayoutHamburgerand aFluentNavcontaining aFluentNavItemwith a relativeHrefto the layout's navigation area. - On a page with unsaved changes, use a
NavigationLockto ask the user to confirm before navigating. - Open the hamburger drawer and click a navigation item.
- In the
OnBeforeInternalNavigationcallback, observe two calls for the same destination:TargetLocation:http://localhost:10000/target,IsNavigationIntercepted:trueTargetLocation:target,IsNavigationIntercepted:false
Relevant layout pattern:
<FluentLayout NavigationDeferredLoading="true">
<FluentLayoutItem Area="LayoutArea.Header">
<FluentLayoutHamburger Display="HamburgerDisplay.DesktopMobile" />
</FluentLayoutItem>
<FluentLayoutItem Area="LayoutArea.Navigation">
<FluentNav>
<FluentNavItem Href="target">
Target
</FluentNavItem>
</FluentNav>
</FluentLayoutItem>
</FluentLayout>
The page registers a NavigationLock while it has unsaved changes.
🤔 Expected Behavior
Clicking a navigation item in the drawer should trigger one navigation request and one confirmation dialog. OK should navigate to the selected page; Cancel should keep the current page open.
😯 Current Behavior
The location-changing callback is invoked twice for the same destination: once for an intercepted link navigation and once for a programmatic navigation using the relative Href.
If the application prevents a second confirmation dialog while the first is open, the second navigation request can be canceled or supersede the first. As a result, selecting OK does not reliably navigate.
💁 Possible Solution
Ensure that drawer navigation uses only one navigation path. FluentNavItem.OnClickHandlerAsync closes an open hamburger and then calls NavigationManager.NavigateTo(Href), while the item is also rendered as a link.
Could the normal link navigation and the drawer-specific programmatic navigation be made mutually exclusive?
🔦 Context
This affects navigation away from pages with unsaved changes. The application uses NavigationLock to let users either discard their changes and proceed or cancel navigation.
🌍 Your Environment
- OS & Device: Windows PC 10.0.26100 build 26100
- Browser: Microsoft Edge 158.0.4370.45
- .NET and Fluent UI Blazor library Version: .NET 10, Microsoft.FluentUI.AspNetCore.Components 5.0.0
- Blazor render mode: Interactive Server
- Ngôn ngữ chính
- C#
- Star
- 4.9k
- Fork
- 500
- Merge trung bình
- 15 giờ 28 phút
- Pull request đã merge (30 ngày)
- 58
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/fluentui-blazor
-
fix: [v5] FluentTextInput throws from ElementInternals during .NET 11 enhanced form navigationĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
microsoft/fluentui-blazor#5721 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
microsoft/fluentui-blazor#5684 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix: option list stays open after a mouse pick in single-select FluentAutocompleteCó thể đã có người làm @dvoituron đã nhận 1 ngày trước. Đang mở
microsoft/fluentui-blazor#5715 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
microsoft/fluentui-blazor#5711 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix: [v5] FluentValidationMessage icon shrinks when the validation message wrapsCó thể đã có người làm @vnbaaij đã nhận 2 ngày trước. Đang mở
microsoft/fluentui-blazor#5703 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/fluentui-blazor
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] speech tts synthesize rejects valid locales such as fil-PH, yue-CN and sr-Latn-RS in --languageCó thể đã có người làm @Shizoqua đã nhận hôm nay. Đang mởAzure.Mcp.Server needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Project dependencies are outdatedCó thể đã có người làm @yasmoradi đã nhận hôm nay. Đang mởdependencies
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
bitfoundation/bitplatform#15616 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
:watch: Not Triaged Pri3
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area-controls-shell platform/android
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
dotnet/maui#41304 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày