-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TreeView issue in v7.0.0-preview4 with multi selection #9126
Comments
@sardar97 I'll fix your issue but I need your help. To be honest, from your video I don't understand what is going on at all. Can you create a minimal example code that reproduces your problem without all your application complexity? I can use that as a test case for creating a fix. Since TryMB is still on v6.x.x you could checkout our dev branch and add a simple example to our treeview docs that exhibits the behavior you reported. Then either PR that example and tag me or post the example code here in this issue |
see it here |
I understand your problem now. Your |
@ScarletKuro The problem we have here is related to our discussion a while ago. Treeview has a parameter [Parameter]
[Category(CategoryTypes.TreeView.Data)]
public IReadOnlyCollection<T>? Items { get; set; } = Array.Empty<T>(); Which are then rendered in the treeview razor using the item template: @foreach (var item in Items)
{
@ItemTemplate(item)
} The problem here is that the I think we should provide a standard Do you concur? |
yes I am, that really make sense. |
I think it would work if you just used the public override bool Equals(object? obj)
{
return obj is TreeItemData data &&
Title == data.Title;
}
public override int GetHashCode()
{
return Title.GetHashCode();
} Edit: or if they are not unique you'll need some kind of unique ID |
The claim value looks like a suitably unique ID |
yeah but the problem is that I have to separate them for better user friendly ui and I don't really know how to handle it :( |
It is easy. Add |
@henon look at this shadow issue as well. Screen.Recording.2024-06-06.at.3.04.33.PM.mov |
yeah it is only in Safari has this issue. |
Yes. |
Imo v7 would be better |
I plan to PR it this weekend. |
Reported by sardar97 in issue comment: #8447 (comment)
There is an issue with TreeView component in v7.0.0-preview4 when I use multi selection and I have child and
I bind-SelectedValues every thing is working fine but the only problem it have is when I want to load some data to the SelectedValues it will not check the chebox. even the ICollection of the SelectedValues has loaded the data but will not check the checkboxes in the tree view. I will show some code and screenshot to more explanation.
and in my opinion the problem is Binding SelectedValues between the parent and child.
Screen.Recording.2024-06-06.at.7.20.14.AM.mov
Originally posted by @sardar97 in #8447 (comment)
The text was updated successfully, but these errors were encountered: