Unplanned
Last Updated: 18 May 2020 16:04 by ADMIN
Marcel
Created on: 30 Mar 2020 20:23
Category: TreeView
Type: Bug Report
3
TreeView does not expand when using async methods

Hello,

I am trying to fill the TreeView using an async method. The first level is loaded an expanded. Subsequent levels are not. Or so it seams. They are loaded, but when expanding a node it expands and immediately collapses. Expanding a second time reveals the nodes loaded earlier.

I included a demo project. Open http://localhost:{port}/tree.

 

Best regards,

Marcel Gelijk

Attached Files:
5 comments
ADMIN
Marin Bratanov
Posted on: 18 May 2020 16:04

Thank you for the information, Jens. I have made a note of this for testing. Something is definitely off, and we will be looking into it.

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Jens
Posted on: 18 May 2020 15:48

It is easily reproducible when you change the OnExpand event handler in the "LazyLoading "example code:

Make it "async Task":

-    async Task OnExpand(TreeViewExpandEventArgs args) ...

Add "Task.Delay..":

+           await Task.Delay(100);

            category.Products.AddRange<Product>(products);
            StateHasChanged();

}

If Task.Delay is inserted before AddRange, the node triangle just flips to "open" and no items appear. Only after clicking the node again twice.

If it is added behind, the node opens with items shortly appearing (seemingly depending on how long the task delays) and collapses. Opening again behaves correctly.

Regards

Jens

ADMIN
Marin Bratanov
Posted on: 31 Mar 2020 19:20

Hello Marcel,

That's very odd and I am logging it for further research. I don't know why the VS debugger would change the behavior. I did reproduce the issue in a WASM app as well, so it is not likely to be caused by the debugger alone.

You can click the Follow button on the feedback portal page to get notifications for status updates.

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Marcel
Posted on: 31 Mar 2020 11:16

Hello Marin,

 

Thanks for your response.

I am using localhost as well. In my opinion performance/network latency is not an issue.

I saw your video and realized a key difference. The behaviour only occurs when I run the browser with the debuggger attached. This is what I see: Youtube. (It's the same demo project)

Any thoughts on how the Visual Studio interferes with the debug experience?

Best regards,

Marcel Gelijk

ADMIN
Marin Bratanov
Posted on: 31 Mar 2020 10:42

Hello Marcel,

The provided sample seems to work fine for me. I am attaching here a short video of the behavior I get so you can confirm if I am missing something. I don't see anything wrong with this treeview sample and it should work.

My best guess at the moment is that either of the following is happening:

  • some browser cache is serving an old JS Interop file for our components, or in the real project our CDN is used and it points to an old version
  • there is some other code that is coming into play that is not present in this sample
  • there is some conflict with the WASM Preview3 HttpClient that is happening in the server app, so you could try downgarding to the Preview2 to compare, or even removing the WASM references, as ASP.NET Core has an HTTP client already.
  • there is a large latency in the setup you have (for example, the app is hosted on a server far away from your office) and the SignalR connection stutters and goes out of sync (delays larger than 100-ish milliseconds tend to render server-side Blazor apps sluggish and often result in similar problems)

 

Regards,
Marin Bratanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Attached Files: