Skip to content

bug(CheckboxListGeneric): MVVM does not working expected #6054

@coddoge

Description

@coddoge

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

2 problems found(see below)

If it's my problem, please tell me, Thanks!

Expected Behavior

  • After page first shown, selected state not matched with bind-value, expected: all checked

Image

  • When click to changed value, bind-value dose not change as expected, expected: AC

Image

Interactive render mode

Interactive WebAssembly (Client-side rendering (CSR) using Blazor WebAssembly)

Steps To Reproduce

<CheckboxListGeneric
	Items="KindFilters"
	@bind-Value="@SelectedKindFilters"
	OnSelectedChanged="@(async (_,_)=>StateHasChanged())" />

@foreach (var item in SelectedKindFilters)
{
	<span>@item</span>
}

@code {
	private readonly System.Collections.Immutable.ImmutableArray<SelectedItem<char>> KindFilters = [
		new ('a',"A"),
		new ('i',"i"),
		new ('c',"C"),
		new ('g',"G"),
	];

	private List<char> SelectedKindFilters = ['a', 'i', 'c', 'g'];
}

Exceptions (if any)

No response

.NET Version

NET9.0

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions