Facepunch / sbox-issues

174 stars 11 forks source link

Error when building render tree on Softsplit.UI.FileTreeItem - Tried to include element 'FileTreeItem' recursively! #5880

Open SwagAccount opened 1 month ago

SwagAccount commented 1 month ago

Describe the bug

I cant recursively include this element and I see no reason why I cannot do that, how do I get around this

To Reproduce

  1. Recursively reference FileTreeItem

Expected behavior

Being able to do this

Media/Files

https://github.com/Softsplit/sandbox-classic/blob/main/Code/UI/MenuSystem/Shared/Settings/FileTree.razor https://github.com/Softsplit/sandbox-classic/blob/main/Code/UI/MenuSystem/Shared/Settings/FileTreeItem.razor

Files in question

Additional context

No response

MD485 commented 1 month ago

Can you just make a FileTreeItem contain a FileTree? Recursion might be helpful in niche scenarios, but I'm not sure it's necessary for a proper UI API.

SwagAccount commented 1 month ago

its needs to recurse because a file tree can be any size and depth

MD485 commented 1 month ago

I don't see why that doesn't apply to the SubItems array you made? It has the same info as a FileTree. You're still recursing, just not recursing using the defining element.