Skip to content

Commit

Permalink
DropDownDataGrid keyboard navigation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
enchev committed Aug 29, 2024
1 parent 0dd993c commit c7c11a1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Radzen.Blazor/RadzenDropDownDataGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,13 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
}

StateHasChanged();
}

if (!Multiple && grid != null)
{
await grid.SelectRow(SelectedItem, false);
if (!Multiple && grid != null && SelectedItem != null)
{
var items = (LoadData.HasDelegate ? Data != null ? Data : Enumerable.Empty<object>() : (pagedData != null ? pagedData : Enumerable.Empty<object>())).OfType<object>().ToList();
selectedIndex = items.IndexOf(SelectedItem);
await JSRuntime.InvokeAsync<int[]>("Radzen.focusTableRow", grid.GridId(), "ArrowDown", selectedIndex - 1, null);
}
}

await base.OnAfterRenderAsync(firstRender);
Expand Down

0 comments on commit c7c11a1

Please sign in to comment.