Skip to content

Commit 2a20ab6

Browse files
committed
Manu out of range exception with arrow down
1 parent 9f2b41b commit 2a20ab6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Radzen.Blazor/RadzenMenu.razor.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ async Task OnKeyPress(KeyboardEventArgs args)
110110
}
111111
else
112112
{
113-
if (key == "ArrowDown")
113+
if (key == "ArrowDown" && currentItems.Count > 0)
114114
{
115+
focusedIndex = Math.Clamp(focusedIndex, 0, currentItems.Count - 1);
116+
115117
var item = currentItems[focusedIndex];
116118

117119
if (item.items.Count > 0)

0 commit comments

Comments
 (0)