Repository: MudBlazor/MudBlazor (2026-04-20T15:57:32Z)

Issue:
MudSelect does not scroll to selected item on open
### Before reporting

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

### What went wrong?

MudSelect does not scroll to selected item on open because Items are populated after OpenMenu() due to component lifecycle.

What happens?
When opening a MudSelect that already has a selected value, the dropdown does not scroll to the selected item. Instead, it always shows the top of the list.

Root Cause
In versions 9.x, the registration mechanism for MudSelectItem was refactored. Items now register with the parent MudSelect via MudSelectContext during the render phase (OnAfterRender). However, the OpenMenu() method, which contains the scroll logic, is called earlier — in response to a user click.

At the moment OpenMenu() executes, the Items collection is still empty because the child MudSelectItem components have not yet registered. Consequently, the condition index > 0 fails, and no scrolling occurs.

### Reproduction link

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

### Reproduction steps

1. Create a MudSelect with several MudSelectItem components.
2. Select any item that is not the first in the list.
3. Close and reopen the select dropdown.
4. The dropdown shows the top of the list without scrolling to the selected item.


### Version (bug)

v9.0.3

### Version (working)

v8.15.0

### Environment

Chrome

### Blazor rendering mode

WASM


Discussion:

Patch:
diff --git a/src/MudBlazor/Components/Select/MudSelect.razor.cs b/src/MudBlazor/Components/Select/MudSelect.razor.cs
index f84998b86f6a..ac7be24f21d7 100644
--- a/src/MudBlazor/Components/Select/MudSelect.razor.cs
+++ b/src/MudBlazor/Components/Select/MudSelect.razor.cs
@@ -703,17 +703,6 @@ public async Task OpenMenu()
             UpdateIcon();
             StateHasChanged();
 
-            //Scroll the active item on each opening
-            if (_activeItemId != null)
-            {
-                var index = Items.FindIndex(x => x.ItemId == _activeItemId);
-                if (index > 0)
-                {
-                    var item = Items[index];
-                    await ScrollToItemAsync(item);
-                }
-            }
-
             //disable escape propagation: if selectmenu is open, only the select popover should close and underlying components should not handle escape key
             await KeyInterceptorService.UpdateKeyAsync(ElementId, new("Escape", stopDown: "key+none"));
         }
@@ -1454,6 +1443,15 @@ await InvokeAsync(async () =>
                         await HighlightItemForValueAsync(ReadValue);
                     }
                 });
+
+                if (_openState.Value && _activeItemId is not null)
+                {
+                    var index = Items.FindIndex(x => x.ItemId == _activeItemId);
+                    if (index > 0)
+                    {
+                        await ScrollToItemAsync(Items[index]);
+                    }
+                }
             }
         }
 


Test patch:
diff --git a/src/MudBlazor.UnitTests/Components/SelectTests.cs b/src/MudBlazor.UnitTests/Components/SelectTests.cs
index a6838a3df37f..db3302bad087 100644
--- a/src/MudBlazor.UnitTests/Components/SelectTests.cs
+++ b/src/MudBlazor.UnitTests/Components/SelectTests.cs
@@ -1146,6 +1146,16 @@ public async Task Select_Should_HilightInitiallySelectedValue()
             await comp.WaitForAssertionAsync(() => comp.Find("div.mud-popover").ClassList.Should().NotContain("mud-popover-open"));
         }
 
+        [Test]
+        public async Task Select_Should_ScrollToInitiallySelectedValue_WhenOpened()
+        {
+            var comp = Context.Render<SelectTest2>();
+
+            await comp.Find("div.mud-input-control").MouseDownAsync();
+            await comp.WaitForAssertionAsync(() => comp.Find("div.mud-popover").ClassList.Should().Contain("mud-popover-open"));
+            await comp.WaitForAssertionAsync(() => Context.JSInterop.VerifyInvoke("mudScrollManager.scrollToListItem"));
+        }
+
         [Test]
         public async Task Select_Should_AllowReloadingItems()
         {