MudSelectExtended: Bug With Virtualize and SelectedItems Style
See original GitHub issueHy, I’m using MudSelectExtended component with record SelectItem
and MultiSelection set to true
. After selecting two or more option closing select and reopening select only the last selected item is marked as selected. Is this bug or I’m doing something wrong?
<MudSelectExtended
T="SelectItem"
MultiSelection="true"
MultiSelectionTextFunc="@(new Func<List<SelectItem>, string>(GetMultiSelectionText))"
ToStringFunc="@(item => item.Text)"
Label="Multi select"
@bind-SelectedValues="BoundItems"
ItemCollection="Items"
SearchBox="true"
Virtualize="true"
Clearable
AnchorOrigin="Origin.BottomCenter"
Variant="Variant.Outlined"/>
@code {
private ICollection<SelectItem> Items = new List<SelectItem>()
{
new(1, "Item 1"),
new(2, "Item 2"),
new(3, "Item 3"),
new(4, "Item 4"),
new(5, "Item 5"),
new(6, "Item 6"),
};
public IEnumerable<SelectItem> BoundItems { get; set; }
private string GetMultiSelectionText(List<SelectItem> selectedValues)
{
return $"{string.Join(", ", selectedValues.Select(x => x.Text))}";
}
public record SelectItem(int Id, string Text);
}
Issue Analytics
- State:
- Created 7 months ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
mat-select with virtual scroll loses selection state · Issue ...
The selected option is no longer displayed (but it's still set). Obs: "mat-select" seems to re-calculate its internal "selectionModel" and " ...
Read more >Angular Material Select styling not behaving correctly
You code seems to be working properly in my test project, and your imports look correct. You may have something overriding the material...
Read more >Select | Angular Material
<mat-select> is a form control for selecting a value from a set of options, similar to the native <select> element. You can read...
Read more >mat-select not showing selected value. : r/Angular2
I'm passing the values for my mat-select via property binding, so my component typescript file looks like this: '@Input() areas!: Area[];
Read more >FlexGrid Class | Wijmo API
The FlexGrid control is a full-featured grid, providing all the features you are used to including several selection modes, sorting, column reordering, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The main issue looks fixed. If you have another issue relates to this, please re-open this issue or open new issue.
Check out my PR #240, I have fixed a few issues to do with selection and virtualisation in it.