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 chipsets not closeable for complex type

See original GitHub issue

I have problems getting MudSelectExtended working with closeable chips + complex type.

On TryMudextensions the close button of chips is not responsive. While with the exact same code on my machine, the chips are not even displayed unless clicking on the input.

What am I doing wrong? Please help!

<MudAlert Severity="Severity.Info" Class="mt-4">
    The following example demostrates chips are not closeable. <br />
    On my machine, chips are not even displayed unless the input is focused.
</MudAlert>

<MudSelectExtended @bind-SelectedValues="animalsSelected" T="Animal" ItemCollection="animals"
                   MultiSelection="true" Label="Animals" SearchBox="true"
                   ChipCloseable="true" ValuePresenter="MudExtensions.Enums.ValuePresenter.Chip"
                   AnchorOrigin="Origin.BottomCenter" />

@code {
    class Animal
    {
        public Guid Id { get; set; }
        public string Name { get; set; }
        public override string ToString() => this.Name;
        public override int GetHashCode() => this.Id.GetHashCode();
        public override bool Equals(object? that) => (that as Animal)?.Id == this.Id;
    }

    private ICollection<Animal> animals = new List<Animal> {
        new Animal { Id = Guid.NewGuid(), Name = "Dog" },
        new Animal { Id = Guid.NewGuid(), Name = "Cat" },
        new Animal { Id = Guid.NewGuid(), Name = "Bear" },
        new Animal { Id = Guid.NewGuid(), Name = "Lion" },
        new Animal { Id = Guid.NewGuid(), Name = "Horse" },
        new Animal { Id = Guid.NewGuid(), Name = "Donkey" },
        new Animal { Id = Guid.NewGuid(), Name = "Sheep" },
    };

    private IEnumerable<Animal> animalsSelected = new List<Animal>();

    protected override void OnInitialized()
    {
        //for demostration, the first 3 items are selected by default
        animalsSelected = animals.Take(3);

        base.OnInitialized();
    }
}

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MilesFancommented, Mar 25, 2023

Thanks for the feedback. At least I don’t doubt myself any more. Hope it will be fixed in the next release. 😃

Awesome project, by the way.

0reactions
mckaragozcommented, Mar 27, 2023

https://user-images.githubusercontent.com/78308169/228045823-7aee767b-9410-4db9-acd4-43fc2f36c4ff.mp4

Now it look like working with both RenderFragment and ItemCollection approach. They both visible initially and can close with complex objects. Will come with next release, but i should say its not final shape of MudSelectExtended, extended one fixes lots of issues, but probably we will wait net 8 for a zero-problem select.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MudSelect with options doesnt close anymore with ESC ...
But the problem is here, that elements which are behind the dropdown window, are not interactable as the dropdown menu "blocks" the sight...
Read more >
Select
Select comes in the variants Text, Filled and Outline. Select is generic, meaning you can use values of any type with it. See...
Read more >
MudSelect Issue in Blazor WASM
But, I have a problem with MudSelect. I want to display the department's name in MudSelect. However, I need to bind DepartmentID ....
Read more >
Mudblazor complex form. To test all our examples we are ...
Mudblazor complex form. To test all our examples we are going to create a simple Blazor WebAssembly client application. NET Core's built-in DataAnnotations ......
Read more >
Mudblazor dynamic tabs. Bug fix (non-breaking change which ...
Init to the property LoadOn. In it's most complex form, the data grid allows filtering, editing, grouping, and much more. mdc-dialog . Some...
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