diff --git a/CHANGELOG.md b/CHANGELOG.md
index a9dc509..71031eb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [0.4.1] - 2026-11-30
+
+### Fixed
+
+- **The Blazor glue called AdminLTE functions that don't exist.** `adminlte-blazor.js`
+ called `Treeview.init`, `PushMenu.init` and `CardWidget.init`, which AdminLTE 4
+ doesn't have, so nothing was re-initialised after Blazor replaced the prerendered
+ layout. On phones, tapping outside the open sidebar no longer closed it. The glue now
+ calls `adminlte.initialize()`, which removes the previous run's listeners before it
+ runs again, and recreates the sidebar's OverlayScrollbars instance when a DOM patch
+ removed it. `DashboardLayout` runs it once after the first interactive render
+ instead of on every render.
+- **Statically rendered pages lost AdminLTE's setup after enhanced navigation.**
+ ` ` now also loads `adminlte-blazor.js` as a module, which re-runs
+ the setup on Blazor's `enhancedload` event.
+- **Menu groups and dropdowns could navigate to the home page.** With
+ `blazor.web.js` loaded first, Blazor treated clicks on `href="#"` toggles as
+ navigation to `/` (via ` `) on statically rendered pages. The docs and
+ the demo now load ` ` before `blazor.web.js`, and the topbar user
+ menu toggle is a ``.
+- **The sidebar stayed open over the new page after navigating on a phone.**
+ `DashboardLayout` now closes it after an interactive navigation below the sidebar
+ breakpoint.
+- **Bootstrap's CSS was loaded twice.** `` and ` `
+ linked `bootstrap.min.css` as well as `adminlte.min.css`, which already contains
+ Bootstrap. The extra link (232 KB) is gone; the file still ships for anyone who
+ links it directly.
+- **Sidebar accessibility.** The sidebar list no longer has `role="menu"` (it is site
+ navigation, not an application menu), matching AdminLTE 4.10.3, and the current
+ link has `aria-current="page"`.
+- **README menu example threw on copy-paste.** It names a `RequireAdmin` policy that
+ was never registered; the example now registers it.
+
+### Changed
+
+- Bundled AdminLTE updated to **4.10.3**.
+
## [0.4.0] - 2026-11-17
### Changed
diff --git a/NUGET.md b/NUGET.md
index fd9efe1..9cf1370 100644
--- a/NUGET.md
+++ b/NUGET.md
@@ -26,6 +26,12 @@ using ColorlibHQ.AdminLTE.AspNetCore;
builder.Services.AddAdminLte(builder.Configuration);
builder.Services.AddHttpContextAccessor(); // needed for the sidebar Tag Helper's active state
+
+// The menu example below restricts its "Admin" item to a "RequireAdmin" policy.
+// Register every policy your menu names, or remove "Policy" from the item: an
+// unknown policy throws InvalidOperationException on every page with the sidebar.
+builder.Services.AddAuthorization(options =>
+ options.AddPolicy("RequireAdmin", policy => policy.RequireRole("Admin")));
```
Define the menu in `appsettings.json`:
@@ -51,10 +57,13 @@ Reference the bundled CSS/JS in `App.razor` and wrap pages in `DashboardLayout`:
```razor
@* App.razor *@
-@* …before , after blazor.web.js *@
+@* …at the end of , BEFORE blazor.web.js *@
+
```
+Keep ` ` before `blazor.web.js`. AdminLTE's menu groups use `href="#"`, which ` ` turns into a link to the home page; Blazor leaves a click alone only if AdminLTE has already handled it, so AdminLTE has to load first. The components also re-run AdminLTE's setup after enhanced navigation and after the first interactive render, so the sidebar overlay, scrollbar and collapsed state survive page changes.
+
```razor
@* MainLayout.razor *@
@inherits LayoutComponentBase
diff --git a/README.md b/README.md
index c5e1785..6b339ca 100644
--- a/README.md
+++ b/README.md
@@ -74,6 +74,12 @@ using ColorlibHQ.AdminLTE.AspNetCore;
builder.Services.AddAdminLte(builder.Configuration);
builder.Services.AddHttpContextAccessor(); // needed for the sidebar Tag Helper's active state
+
+// The menu example below restricts its "Admin" item to a "RequireAdmin" policy.
+// Register every policy your menu names, or remove "Policy" from the item: an
+// unknown policy throws InvalidOperationException on every page with the sidebar.
+builder.Services.AddAuthorization(options =>
+ options.AddPolicy("RequireAdmin", policy => policy.RequireRole("Admin")));
```
Define the menu in `appsettings.json`:
@@ -106,10 +112,13 @@ Reference the bundled CSS/JS in your `App.razor` and wrap pages in `DashboardLay
```razor
@* App.razor *@
-@* …before , after blazor.web.js *@
+@* …at the end of , BEFORE blazor.web.js *@
+
```
+Keep ` ` before `blazor.web.js`. AdminLTE's menu groups use `href="#"`, which ` ` turns into a link to the home page; Blazor leaves a click alone only if AdminLTE has already handled it, so AdminLTE has to load first. The components also re-run AdminLTE's setup after enhanced navigation and after the first interactive render, so the sidebar overlay, scrollbar and collapsed state survive page changes.
+
```razor
@* MainLayout.razor *@
@inherits LayoutComponentBase
diff --git a/RELEASING.md b/RELEASING.md
index 5ca69cf..4bc8cc4 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -20,7 +20,7 @@ ASP.NET Core package and publish it to [nuget.org](https://www.nuget.org/).
The package version is the `` element in
`src/ColorlibHQ.AdminLTE.AspNetCore/ColorlibHQ.AdminLTE.AspNetCore.csproj`.
-Update it to the new release version (the port family currently tracks `0.2.0`):
+Update it to the new release version:
```xml
0.2.0
diff --git a/samples/AdminLte.Demo/Components/App.razor b/samples/AdminLte.Demo/Components/App.razor
index 2fe7b58..d27efb6 100644
--- a/samples/AdminLte.Demo/Components/App.razor
+++ b/samples/AdminLte.Demo/Components/App.razor
@@ -26,9 +26,10 @@
-
- @* Bootstrap bundle + AdminLTE JS, from the RCL. *@
+ @* Bootstrap bundle + AdminLTE JS, from the RCL. Before blazor.web.js, so their
+ click handlers cancel href="#" toggles before Blazor sees the click. *@
+
@* CDN plugin libraries + the demo interop module for the JS-plugin pages. *@
diff --git a/samples/AdminLte.Demo/appsettings.json b/samples/AdminLte.Demo/appsettings.json
index 3d8b144..d3aec31 100644
--- a/samples/AdminLte.Demo/appsettings.json
+++ b/samples/AdminLte.Demo/appsettings.json
@@ -9,7 +9,7 @@
"AdminLte": {
"BrandText": "AdminLTE 4",
"BrandUrl": "/",
- "LogoImage": "https://cdn.jsdelivr.net/npm/admin-lte@4.10.2/dist/assets/img/AdminLTELogo.png",
+ "LogoImage": "https://cdn.jsdelivr.net/npm/admin-lte@4.10.3/dist/assets/img/AdminLTELogo.png",
"SidebarTheme": "dark",
"DefaultColorMode": "auto",
"ColorModeToggle": true,
diff --git a/src/ColorlibHQ.AdminLTE.AspNetCore/ColorlibHQ.AdminLTE.AspNetCore.csproj b/src/ColorlibHQ.AdminLTE.AspNetCore/ColorlibHQ.AdminLTE.AspNetCore.csproj
index beb7847..6cd3543 100644
--- a/src/ColorlibHQ.AdminLTE.AspNetCore/ColorlibHQ.AdminLTE.AspNetCore.csproj
+++ b/src/ColorlibHQ.AdminLTE.AspNetCore/ColorlibHQ.AdminLTE.AspNetCore.csproj
@@ -15,7 +15,7 @@
ColorlibHQ.AdminLTE.AspNetCore
- 0.4.0
+ 0.4.1
Colorlib
Colorlib
AdminLTE 4 for ASP.NET Core
@@ -30,7 +30,7 @@
icon.png
Copyright (c) 2014-2026 Colorlib
- Bundled AdminLTE 4.10.2 and Bootstrap 5.3.9 (print defaults, data-lte-print, data-lte-contrast, data-lte-primary). The demo now uses Chart.js instead of ApexCharts.
+ Fixes the Blazor glue: AdminLTE's setup now re-runs after the first interactive render and after enhanced navigation (sidebar overlay, scrollbar, collapsed state), and the sidebar closes after navigation on phones. Stylesheets no longer load Bootstrap twice. Sidebar drops role="menu" and marks the current link with aria-current. Bundled AdminLTE 4.10.3.
true
snupkg
true
diff --git a/src/ColorlibHQ.AdminLTE.AspNetCore/Components/AdminLteScripts.razor b/src/ColorlibHQ.AdminLTE.AspNetCore/Components/AdminLteScripts.razor
index b826c10..014ffbb 100644
--- a/src/ColorlibHQ.AdminLTE.AspNetCore/Components/AdminLteScripts.razor
+++ b/src/ColorlibHQ.AdminLTE.AspNetCore/Components/AdminLteScripts.razor
@@ -1,9 +1,19 @@
-@* Blazor-friendly equivalent of the tag helper. Place near
- the end of in a Blazor App.razor, after blazor.web.js. *@
+@* Blazor-friendly equivalent of the tag helper. Place it at the
+ end of in App.razor, BEFORE
+
@code {
private const string Base = "/_content/ColorlibHQ.AdminLTE.AspNetCore";
diff --git a/src/ColorlibHQ.AdminLTE.AspNetCore/Components/AdminLteStyles.razor b/src/ColorlibHQ.AdminLTE.AspNetCore/Components/AdminLteStyles.razor
index 3d1afef..30a17ee 100644
--- a/src/ColorlibHQ.AdminLTE.AspNetCore/Components/AdminLteStyles.razor
+++ b/src/ColorlibHQ.AdminLTE.AspNetCore/Components/AdminLteStyles.razor
@@ -1,8 +1,8 @@
@* Blazor-friendly equivalent of the tag helper: renders the
- AdminLTE/Bootstrap stylesheet links plus the no-flash color-mode script.
+ stylesheet links plus the no-flash color-mode script. adminlte.css already
+ contains Bootstrap's CSS, so Bootstrap's own stylesheet is not loaded.
Use in a Blazor App.razor . (Tag Helpers don't run inside .razor.) *@
-
diff --git a/src/ColorlibHQ.AdminLTE.AspNetCore/Components/Layout/DashboardLayout.razor b/src/ColorlibHQ.AdminLTE.AspNetCore/Components/Layout/DashboardLayout.razor
index d9661e5..ef04664 100644
--- a/src/ColorlibHQ.AdminLTE.AspNetCore/Components/Layout/DashboardLayout.razor
+++ b/src/ColorlibHQ.AdminLTE.AspNetCore/Components/Layout/DashboardLayout.razor
@@ -1,6 +1,6 @@
@* The full AdminLTE app shell: topbar + sidebar + content + footer.
Reads AdminLteOptions for branding/menu and the current path for active state.
- Re-initialises AdminLTE's JS plugins after each interactive render. *@
+ Re-runs AdminLTE's setup once the layout becomes interactive. *@
@implements IAsyncDisposable
@inject IOptions Options
@inject IMenuService MenuService
@@ -81,6 +81,7 @@
private IReadOnlyList _menu = Array.Empty();
private CommandPalette? _palette;
private IJSObjectReference? _module;
+ private bool _navigated;
///
/// Optional principal used to filter the menu/palette to authorized items.
@@ -101,10 +102,20 @@
{
_module = await JS.InvokeAsync(
"import", "./_content/ColorlibHQ.AdminLTE.AspNetCore/js/adminlte-blazor.js");
- }
- // Re-bind AdminLTE plugins to the freshly rendered DOM on every render.
- if (_module is not null)
+ // The interactive render replaced the prerendered layout that AdminLTE set up on
+ // DOMContentLoaded (sidebar overlay, push-menu state, scrollbar). Set it up again.
await _module.InvokeVoidAsync("initAdminLte");
+ }
+ else if (_module is not null)
+ {
+ // Later renders patch the same elements; only restore the scrollbar if it was lost.
+ await _module.InvokeVoidAsync("refreshAdminLte");
+ if (_navigated)
+ {
+ _navigated = false;
+ await _module.InvokeVoidAsync("closeSidebarOnMobile");
+ }
+ }
}
private Task OpenPaletteAsync() => _palette?.OpenPalette() ?? Task.CompletedTask;
@@ -112,6 +123,7 @@
private void OnLocationChanged(object? sender, LocationChangedEventArgs e)
{
UpdateCurrentPath();
+ _navigated = true;
InvokeAsync(StateHasChanged);
}
diff --git a/src/ColorlibHQ.AdminLTE.AspNetCore/Components/Layout/SidebarNav.razor b/src/ColorlibHQ.AdminLTE.AspNetCore/Components/Layout/SidebarNav.razor
index 48da6e7..2dcf1f3 100644
--- a/src/ColorlibHQ.AdminLTE.AspNetCore/Components/Layout/SidebarNav.razor
+++ b/src/ColorlibHQ.AdminLTE.AspNetCore/Components/Layout/SidebarNav.razor
@@ -2,8 +2,7 @@