Completed
Last Updated: 03 Jul 2026 06:07 by Jan
Release 2026 14.1.0 (Jul)
David Rhodes
Created on: 18 Jun 2026 10:11
Category: TabStrip
Type: Bug Report
4
ActiveTabIdChanged fires on app navigation

The TabStrip ActiveTabIdChanged event fires when the user navigates to another page.

The workaround is to detect app navigation and prevent the business logic execution. The example below is for the general case. If the app navigates programmatically with NavigationManager.NavigateTo(), you can set the IsNavigating flag immediately before that.

@implements IDisposable
@inject NavigationManager NavManager

<TelerikTabStrip ActiveTabId="@ActiveTabId"
                 ActiveTabIdChanged="@TabStripActiveTabIdChanged">
    @for (int i = 1; i <= TabCount; i++)
    {
        int tabIndex = i;

        <TabStripTab @key="@tabIndex" Title="@($"Tab {tabIndex}")" Id="@($"tab{tabIndex}")">
            <h2>Tab @tabIndex</h2>
        </TabStripTab>
    }
</TelerikTabStrip>

@code {
    private string ActiveTabId { get; set; } = "tab1";

    private bool IsNavigating { get; set; }

    private const int TabCount = 3;
    

    private async Task TabStripActiveTabIdChanged(string newActiveTabId)
    {
        if (IsNavigating)
        {
            return;
        }

        ActiveTabId = newActiveTabId;
    }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        if (firstRender)
        {
            locationChangingRegistration = NavManager.RegisterLocationChangingHandler(OnLocationChanging);
        }
    }

    private IDisposable? locationChangingRegistration;

    private ValueTask OnLocationChanging(LocationChangingContext context)
    {
        IsNavigating = true;

        return ValueTask.CompletedTask;
    }

    public void Dispose() => locationChangingRegistration?.Dispose();
}

2 comments
Jan
Posted on: 03 Jul 2026 06:07

uh, never mind. I updated several other blazor packages but Blazor.Ui wasn't yet release. ignore my first comment

 

Jan
Posted on: 03 Jul 2026 06:06
I just checked if this is fixed in 2026.2.624 and it seem's this is not the case. How does the above mentioned version "2026 14.1.0 (Jul)" relate to the Blazor package versions or is there any web page that links these two versions?