In Development
Last Updated: 21 Oct 2026 14:27 by ADMIN
Scheduled for 2026 (Nov)
Walter
Created on: 21 Oct 2026 13:32
Category: UI for Blazor
Type: Bug Report
0
TabStrip does not dispose Tab JS instances

Bug report

Reproduction of the problem

(bug report only)
Environment

  • Version 15.1.0
  • Blazor Server, .NET 10
  • Chromium (Chrome and Playwright headless)

TabStrip Tab is never destroyed
Components/TabStrip/Tab.razor.cs registers each tab with initTabStripTab in OnAfterRenderAsync. Its Dispose() only releases the DotNetObjectReference; it never calls InvokeDisposeAsync(). The JS Tab.destroy() method is therefore never called, and TabStrip.destroy() does not destroy its child tabs. Every tab stays in window.TelerikBlazor._instances with its detached <li class="k-tabstrip-item">, which again keeps the disposed page reachable.

  1. Create two routable pages. PageA has TabStrip with 3 tabs. PageB is empty.
  2. Open PageA, then navigate to PageB with the in-app router (no full reload).
  3. Run this in the browser console:
Object.entries(TelerikBlazor._instances)
     .filter(([k, i]) => i && i.element && !i.element.isConnected)
     .map(([k, i]) => k + ' / ' + i.constructor.name)

Sample project attached.

TelerikBlazorApp1.zip

Current behavior

(optional)
One entry per TabStrip tab is returned, all pointing at detached elements. Each pageA -> pageB round trip adds more, and the detached DOM is never released.

Expected/desired behavior

An empty array is returned. PageA's components were disposed, so their JS instances should have been destroyed.

Workaround

After each navigation, we destroy and remove any registered instance whose element is no longer in the page:

const instances = window.TelerikBlazor && window.TelerikBlazor._instances;
   for (const key of Object.keys(instances || {})) {
       const i = instances[key];
       if (i && i.element && !i.element.isConnected) {
           try { i.destroy && i.destroy(); } catch (e) { }
           delete instances[key];
       }
   }

Suggested Fix

  1. In Tab.Dispose(), call InvokeDisposeAsync() before base.Dispose(), as TelerikTabStrip.Dispose() does.

Environment

  • Kendo/Telerik version:
  • Browser: [Chrome XX , Firefox]
0 comments