Skip to content

Commit

Permalink
Fixed Tabs OnKeyPress out of range exception
Browse files Browse the repository at this point in the history
  • Loading branch information
enchev committed Nov 29, 2024
1 parent f8464d6 commit 0d3b86d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Radzen.Blazor/RadzenTabs.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ async Task OnKeyPress(KeyboardEventArgs args)
{
var key = args.Code != null ? args.Code : args.Key;

var item = tabs.ElementAtOrDefault(focusedIndex) ?? tabs[0];
var item = tabs.ElementAtOrDefault(focusedIndex) ?? tabs.FirstOrDefault();

if (item == null) return;

if (key == "ArrowLeft" || key == "ArrowRight")
{
Expand Down

0 comments on commit 0d3b86d

Please sign in to comment.