#13895·MudBlazor

MudSwitch becomes visually stuck when `Disabled` is changed from a long-running `ValueChanged` callback

Author: michalpaukertCreated Sep 23, 2026Updated Sep 23, 2026
Labelsbug

Before reporting

  • I searched existing issues
  • I tried in private/incognito browser

What went wrong?

Description

MudSwitch can become visually stuck when its Disabled parameter is bound to a value that is changed from inside a long-running ValueChanged callback.

The issue is reproducible in the following TryMudBlazor snippet:

https://try.mudblazor.com/snippet/maQqkDmHyxzelIGz

Removing the Disabled parameter makes the switch behave normally.

Minimal reproduction

razor
<MudSwitch T="bool"
           Value="@_exampleValue"
           ValueChanged="OnExampleValueChanged"
           Disabled="@_exampleValueUpdateInProgress"
           Color="Color.Primary" />

@code {
    private bool _exampleValue;
    private bool _exampleValueUpdateInProgress;

    private async Task OnExampleValueChanged(bool value)
    {

        var previousValue = _exampleValue;

        _exampleValue = value;
        _exampleValueUpdateInProgress = true;

        await InvokeAsync(StateHasChanged);

        try
        {
            await Task.Delay(1000);
        }
        catch
        {
            _exampleValue = previousValue;
        }
        finally
        {
            _exampleValueUpdateInProgress = false;
            await InvokeAsync(StateHasChanged);
        }
    }
}
Image

Reproduction link

https://try.mudblazor.com/snippet/QamUuDmxyxWhiqSm

Reproduction steps

Click on MudSwitch

Version (bug)

v9.10.0

Last working version

No response

Environment

No response

Blazor rendering mode

Interactive WebAssembly