question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MudSelectExtended: Bug With Virtualize and SelectedItems Style

See original GitHub issue

Hy, 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:closed
  • Created 7 months ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mckaragozcommented, Jul 7, 2023

The main issue looks fixed. If you have another issue relates to this, please re-open this issue or open new issue.

0reactions
radderzcommented, Jul 6, 2023

Check out my PR #240, I have fixed a few issues to do with selection and virtualisation in it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found