Repository: MudBlazor/MudBlazor (2026-04-15T00:46:21Z)

Issue:
MudSelect: Does not show validation error on focus loss
### Before reporting

- [x] I searched existing issues
- [x] I tried in private/incognito browser

### What went wrong?

Hi,

My example code can be found here: https://try.mudblazor.com/snippet/QYwpPPwgBPfgLWSf

I have an issue that MudSelects in custom components and in the main page do not show validation errors when changing focus. The example text field does show a validation error that it is empty the moment you tab out of it without setting a value.

Additionally, you can see that validation does happen, as the text below the form does show that the form is invalid when selections are not made. But fields are not highlighted.

Main page:
```cs
<MudForm @bind-IsValid="@_isFormValid">

    <MudSelect T="string" @bind-Value="_car" Label="Car" Required="true">
        <MudSelectItem T="string" Value="@("City")"></MudSelectItem>
        <MudSelectItem T="string" Value="@("Track")"></MudSelectItem>
        <MudSelectItem T="string" Value="@("Limo")"></MudSelectItem>
    </MudSelect>

    <ColorSelector @bind-Color="_color"/>

    <MudTextField @bind-Value="_text" Label="Text field" Variant="Variant.Text" Required="true"/>

</MudForm>

@if (_isFormValid)
{
    <MudText>Valid</MudText>
}
else
{
    <MudText>NOT Valid</MudText>
}

@code {
    private string _color;
    private string _car;
    private bool _isFormValid;
    private string _text;
}
```

Color selector:
```cs
@using System.Linq.Expressions

<MudSelect T="string" @bind-Value="_color" Label="Color" Required="true">
    <MudSelectItem T="string" Value="@("Red")"></MudSelectItem>
    <MudSelectItem T="string" Value="@("Green")"></MudSelectItem>
    <MudSelectItem T="string" Value="@("Blue")"></MudSelectItem>
</MudSelect>

@code {
    [Parameter]
    public string? Color { get;set; }

    [Parameter]
    public EventCallback<string?> ColorChanged { get; set; }

    [Parameter]
    public Expression<string?> TestExpression { get; set; }

    private string? _color;
}
```

**Expected result:**
When tabbing out of the unselected/empty MudSelect I want to show a red border and error message the same as it is done for the text field.

### Reproduction link

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

### Reproduction steps

1. Open page
2. Use TAB or mouse clicks to go through elements of the form.
3. Notice that only the text fields show red error when left without the text.
3. Notice that validation does fire as the form validation status show correct value.
4. Notice that red outline and error text is missing for MudSelect elements


### Version (bug)

v8.14.0

### Version (working)

_No response_

### Environment

Edge, Firefox

### Blazor rendering mode

WASM


Discussion:
Maybe related to this: #12138
This is still an issue in 9.1.0. It would be good to fix this as it's quite important to show an error if a field is required but nothing is selected. I believe is this related to (or the same as) the issue #12406 



Patch:
diff --git a/src/MudBlazor/Components/Select/MudSelect.razor.cs b/src/MudBlazor/Components/Select/MudSelect.razor.cs
index f84998b86f6a..a2f69e2aafeb 100644
--- a/src/MudBlazor/Components/Select/MudSelect.razor.cs
+++ b/src/MudBlazor/Components/Select/MudSelect.razor.cs
@@ -731,7 +731,6 @@ public async Task CloseMenu(bool focusAgain = true)
             if (focusAgain)
             {
                 StateHasChanged();
-                await OnBlur.InvokeAsync(new FocusEventArgs());
                 _elementReference.FocusAsync().CatchAndLog(ignoreExceptions: true);
                 StateHasChanged();
             }
@@ -994,7 +993,7 @@ await SetCustomizedTextAsync(string.Join(Delimiter, _selectedValues.Select(Conve
             }
         }
 
-        private async Task OnFocusOutAsync()
+        private async Task OnFocusOutAsync(FocusEventArgs args)
         {
             if (_openState.Value)
             {
@@ -1002,6 +1001,10 @@ private async Task OnFocusOutAsync()
                 // otherwise we can't receive key strokes any longer
                 await FocusAsync();
             }
+            else
+            {
+                await OnBlurredAsync(args);
+            }
         }
 
         private Task SelectNextItem() => SelectAdjacentItem(+1);
@@ -1363,7 +1366,7 @@ private async Task HandleCharacterSearchAsync(KeyboardEventArgs args)
 
         internal Task OnBlurAsync(FocusEventArgs obj)
         {
-            return base.OnBlur.InvokeAsync(obj);
+            return OnBlurredAsync(obj);
         }
 
         protected override void OnInitialized()


Test patch:
diff --git a/src/MudBlazor.UnitTests/Components/SelectTests.cs b/src/MudBlazor.UnitTests/Components/SelectTests.cs
index a6838a3df37f..280344daaacc 100644
--- a/src/MudBlazor.UnitTests/Components/SelectTests.cs
+++ b/src/MudBlazor.UnitTests/Components/SelectTests.cs
@@ -712,6 +712,7 @@ await comp.InvokeAsync(async () =>
             {
                 await select.Instance.OpenMenu();
                 await select.Instance.CloseMenu();
+                await comp.Find($"#{select.Instance.ElementId}").TriggerEventAsync("onfocusout", new FocusEventArgs());
             });
             eventCounter.Should().Be(1);
         }
@@ -1078,6 +1079,23 @@ public async Task Select_Should_SetRequiredTrue()
             select.ValidationErrors.First().Should().Be("Required");
         }
 
+        /// <summary>
+        /// Required MudSelect should show validation error on focus loss without a value selected.
+        /// </summary>
+        [Test]
+        public async Task Select_Required_Should_ShowValidationError_OnFocusOut()
+        {
+            var comp = Context.Render<SelectRequiredTest>();
+            var select = comp.FindComponent<MudSelect<string>>().Instance;
+            select.Required.Should().BeTrue();
+            select.HasErrors.Should().BeFalse();
+            select.Touched.Should().BeFalse();
+            await comp.InvokeAsync(async () => await comp.Find($"#{select.ElementId}").TriggerEventAsync("onfocusout", new FocusEventArgs()));
+            select.Touched.Should().BeTrue();
+            select.HasErrors.Should().BeTrue();
+            select.ValidationErrors.First().Should().Be("Required");
+        }
+
         /// <summary>
         /// Selected option should be hilighted when drop-down opens
         /// </summary>