RadzenTabs does not refresh UI after external barcode scanner event starting from Radzen.Blazor 10.2.0

Hi,

I think there may be a regression or behavior change in RadzenTabs starting from Radzen.Blazor 10.2.0.

I have a .NET MAUI Blazor Hybrid mobile app using a hardware barcode scanner. The scanner sends barcode values through WeakReferenceMessenger.

The scanner event is received correctly, and my C# code runs correctly. Database calls, toast messages, speech messages, and other logic all work.

The important detail is this:

The page works correctly when I stay on the same tab.
The problem usually happens after I switch to another tab and then come back to the scanner tab. After returning to the tab, the scanner still fires and the code still runs, but the visible UI does not refresh anymore.

I tested the versions and found this:

Radzen.Blazor 10.0.0  -> works
Radzen.Blazor 10.1.0  -> works
Radzen.Blazor 10.2.0  -> UI does not update after switching tabs and returning
Radzen.Blazor 10.3.1  -> UI does not update after switching tabs and returning

So the issue seems to start from 10.2.0.

Scenario

I have a parent page with tabs:

<RadzenTabs Change="@OnChange"
            TabPosition="@tabPosition"
            RenderMode="TabRenderMode.Server"
            class="rz-h-100">
    <Tabs>
        <RadzenTabsItem Text="Create">
            <CreatePalletViewPage />
        </RadzenTabsItem>

        <RadzenTabsItem Text="Remove">
            <RemoveFromPallet />
        </RadzenTabsItem>

        <RadzenTabsItem Text="Location">
            <SetPalletLocationViewPage />
        </RadzenTabsItem>
    </Tabs>
</RadzenTabs>

Inside one of the child pages, I also have another RadzenTabs.

The barcode scanner page works normally at first. If I scan a pallet or product barcode without changing tabs, the UI updates correctly.

However, after I go to another tab and then return to the scanner tab, the scanner event is still received and the backend logic still runs, but the visible UI no longer updates.

Scanner callback

The scanner event is registered like this:

WeakReferenceMessenger.Default.Unregister<BarcodeScannedMessage>(this);

WeakReferenceMessenger.Default.Register<BarcodeScannedMessage>(this, (r, m) =>
{
    _ = InvokeAsync(async () =>
    {
        try
        {
            await HandleBarcodeScannedAsync(m.Value);
            StateHasChanged();
        }
        catch (Exception e)
        {
            ToastService.ShowError(e.Message);
        }
    });
});

Inside HandleBarcodeScannedAsync, I update component properties:

selectedIndex = 0;
LatestPalletBarcode = value;
ScannedResult = "Pallet number scanned";

await PalletBarcodeChanged(value);

StateHasChanged();

The barcode logic executes correctly. For example, the pallet barcode is processed, local database operations run, and toast/speech messages are triggered.

But after switching to another tab and returning, the UI does not visually refresh in 10.2.0 or later.

What I tried

I tried:

InvokeAsync(StateHasChanged)

I also tried:

await InvokeAsync(StateHasChanged);
await Task.Yield();

I tried moving scanner registration to a separate method.

I also made sure initialization data is only loaded once, because I thought repeated initialization might reset the UI state.

I tested both:

RenderMode="TabRenderMode.Server"

and:

RenderMode="TabRenderMode.Client"

The issue still happens in 10.2.0 and 10.3.1, usually after switching away from the scanner tab and then returning.

Expected behavior

After switching tabs and returning, when an external barcode scanner event updates component properties and calls InvokeAsync(StateHasChanged), the visible tab content should refresh.

Actual behavior

The scanner event fires and the C# code runs, but after switching tabs and returning, the visible UI remains unchanged when the page contains RadzenTabs, starting from Radzen.Blazor 10.2.0.

The same page works correctly with Radzen.Blazor 10.0.0 and 10.1.0.

Question

Was there any change in RadzenTabs around 10.2.0 that could affect rendering after changing tabs and returning to a tab?

Is there a recommended way to force UI refresh for externally triggered events, such as barcode scanner messages, after a tab has been deactivated and activated again?

For now, staying on Radzen.Blazor 10.1.0 seems to avoid the issue.

This will fix it: RadzenTabs does not refresh UI in some cases · radzenhq/radzen-blazor@bbc179b · GitHub

We will publish update later today.

Thank you very much for the quick response and for fixing it.

Thank you so much. It works correctly in version 10.3.2.

I tested it again after updating, and the UI refresh issue after switching tabs is fixed.