RadzenTabs throws error when empty and "tab"-button hit

I have been getting some Tabs errors every now and then, and havent been able to figure out the problem before now.

I have a RadzenTabs in a SidebarDialog where there is dynamically added and removed tabs.
When the RadzenTabs is empty and the user hits the "Tab"-button on the keyboard it can throw this error.

Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
      System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
         at System.Collections.Generic.List`1.get_Item(Int32 index)
         at Radzen.Blazor.RadzenTabs.OnKeyPress(KeyboardEventArgs args)
         at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

To re-create this problem on your demos page go to TabItems modify and remove all items for the RadzenTabs. Afterwards hold down the "tab"-button on the keyboard.

Regards
Ole

Fix will be part of our next update Monday:

1 Like