Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How can I wrap the child nodes of a in a without breaking the style?

$
0
0

I am using the TreeView of Fluent UI for Blazor and try to combine it with Sortable JS.I followed the example of Sortable JS for nested sortables and set everything up - but now I'm having the problem that when I set the class (which is used to find the elements for which a new sortable is created) on the FluentTreeItem itself (the folder in my case) the item isn't draggable. The children, however, work as expected.

I assume that if I wrap all children of a folder in a <div> and set the class there, this problem will be solved. Unfortunately, wrapping the child nodes in a <div>, even without setting a class, messes up the style - especially the expand folder part of the fluent component and the vertical listing.

This is my CustomTreeItem (which uses the FluentTreeItem):

<FluentTreeItem>  @Node.Name<div>     @foreach (var child in Node.Children)     {<CustomTreeItem Node="@child"></CustomTreeItem>     }</div></FluentTreeItem>

Then I use the component for the FluentTreeView:

<FluentTreeView Data="@TreeItems"><div>    @foreach (var node in GetFilterdNodes())    {<CustomTreeItem Node="@node"></CustomTreeItem >    }</div></FluentTreeView>

I expect it to look like this

As soon as I insert the <div>


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>