Closed pk9r closed 11 months ago
I just found #938, I think we need to do something about this at least change InteractiveAuto to InteractiveServer. It's not nice when a template throws an error because of a default option.
I'm changing this for the next version of the templates (4.0.1). It will behave like this: | Rendermode / Interactivity | NavMenu @rendermode | NavMenu Collapsible | WC script in body |
---|---|---|---|---|
SSR / not applicable | ❌ | ❌ | ✅ | |
Server / Global | ❌ | ✅ | ❌ | |
Server / Per Page | ✅ | ✅ | ❌ | |
WebAssembly / Global* | ❌ | ✅ | ❌ | |
WebAssembly / Per Page* | ✅ | ✅ | ❌ | |
Auto / Global* | ❌ | ✅ | ❌ | |
Auto / Per Page* | ✅ | ✅ | ❌ |
*NavMenu moved to Client project
🐛 Bug Report
FluentBlazorWebAppTemplate
.💁 Possible Solution
When Interactive Render Mode is Auto,
NavMenu
with@rendermode InteractiveAuto
but not in Client project. This will cause an error when the render mode changes to client-side. https://github.com/microsoft/fluentui-blazor/blob/538fd96a14d5ba3cdbd80225fa9113300306dba3/src/Templates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Components/Layout/NavMenu.razor#L4C26-L4C26See more at: https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0#auto-render-mode
NavMenu
to the Client project, as a result this error no longer appears and I think this is fine.@rendermode InteractiveAuto
which caused the collapse button to not work, the only render mode that made it work when not in a Client project was InteractiveServer🌍 Your Environment