Closed day-draze closed 2 weeks ago
The code you provided is not a reproduction we can use and does not demonstrate the issue. I need to be able to copy, paste and run. Besides, I dont understand from your description what you are trying to accomplish. Please make it more clear what you want to do. We can not just clear the list because we can't 'transport' that to the underlying web component.
No repro provided
π Bug Report
The moment we try to load in data dynamic to the fluent tabs (in our case we load data on a navigation click, and on another navigation click we fill it with other data, and then when we press on the first navigation button again) it starts complaining about duplicate keys in the _tabs array.
π» Repro or Code Sample
@code { put some data, then some other data, and then the first data again on a component that calls this [Parameter] List Items = new List();
}
π€ Expected Behavior
It should just display the items it has in the list. So basically clear the list.
π― Current Behavior
Allows changes to other items, but once you start loading in data you already had in there at some previous point, it complains that _tabs already contains this key
π Possible Solution
There are two routes, either there gets made a fix that on a set of the list, there gets checked which items have left the array, based on the ID. or you give us the option to manually clear the array:
///
/// Clear the tabs array
///
public async Task ClearTabs()
{
_tabs.Clear();
}
π¦ Context
This issue has affected me in the sense that i looked annoyed at my screen way to long, but in all seriousness, we need to have tracking of what is actually still in the tabs array, and not keep track of items that are not there anymore on a c#/blazor level.
π Your Environment
Ran on a beautiful Windows 11 Lenovo thinkpad, .net 8.