Skip to content
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

[Bug]: Virtualize isn't virtualizing... #5824

Open
tesar-tech opened this issue Nov 6, 2024 · 6 comments
Open

[Bug]: Virtualize isn't virtualizing... #5824

tesar-tech opened this issue Nov 6, 2024 · 6 comments
Assignees
Labels
Type: Bug 🐞 Something isn't working

Comments

@tesar-tech
Copy link
Collaborator

tesar-tech commented Nov 6, 2024

Blazorise Version

1.6.2

What Blazorise provider are you running on?

Bootstrap5

Link to minimal reproduction or a simple code snippet

I was exploring the #5793 and discovered weird issue with ListView and Virtualize flag.

Simple ListView

@using Blazorise.Components
@using Blazorise

<ListView TItem="int"
          Data="list"
          TextField="item => item.ToString()"
          ValueField="item => item.ToString()"
          Virtualize/>

<Button Color="Color.Primary" Clicked="() => {}" >a Button</Button>

@code {
    List<int> list = Enumerable.Range(0, 1000).ToList();
}

Steps to reproduce

The Virtualized list is displayed correctly, even works correctly. But once you "force" it to do some re-render (for example by clicking a button) it spits out all the <li> into the dom...

413f81fd-6376-4000-9480-71cfa47a8343.mp4

.net8, wasm only.

I will share a bug repo once you confirm it's something we should care about. Not sure about Blazor Server and other components where virtualization is a thing.

My guess is that it is somehow related to the RenderFragment which is inside the virtualize component... because it doesn't have the key (the key is rather inside the fragment).

What is expected?

Virtualize shouldn't have all the elements at once (unless small list)...

What is actually happening?

Simple button click forces the Virtualize to add all the elements to the dom.

What browsers do you see the problem on?

Microsoft Edge

Any additional comments?

No response

Edit:

Observations:

  • doesn't happen on server interactivity
  • doesn't happen on DataGrid
@tesar-tech tesar-tech added the Type: Bug 🐞 Something isn't working label Nov 6, 2024
@stsrki
Copy link
Collaborator

stsrki commented Nov 7, 2024

We can look into this after 1.7 release. And fix it as part of the maintenance update.

@David-Moreira
Copy link
Contributor

We can look into this after 1.7 release. And fix it as part of the maintenance update.

Should we not make an effort to fix this now known bug in 1.6 and merge to master and have it right away on 1.7?

@stsrki
Copy link
Collaborator

stsrki commented Nov 8, 2024

We don't have much time for 1.6 now, so we need to focus on releasing 1.7 next week.

@David-Moreira
Copy link
Contributor

David-Moreira commented Nov 8, 2024

It's not only a 1.6 concern. But 1.7 also. You are knowingly releasing a hug in a stable version. And it's a bug in a somewhat "basic" feature.

@stsrki
Copy link
Collaborator

stsrki commented Nov 8, 2024

We need to prioritize the issues for our upcoming release to ensure that we are focusing our efforts effectively. While we’ve come across the current issue, it’s important to note that it was discovered accidentally and is not as critical as some of the other concerns we’re addressing.

So I would like us to concentrate on the more pressing issues first, which will have a greater impact on our release.

@tesar-tech
Copy link
Collaborator Author

This one is interesting...

  • Applies only to users without a Blazorise license key.
  • Occurs only in WASM.
  • Root cause: Likely a bug in WASM.
  • Detailed issue:
    • The problem starts at this line inside ListView.
    • The way WASM handles the Take method causes it to "strip down" the ICollection "identity" (the suspected bug), which makes it incompatible with the Virtualize component.

Not critical:
Non-licensed users are capped at displaying 1000 lines, which is effectively handled by witnout the Virtualize component.

Next steps:
I suggest waiting for a response from the .NET runtime team before taking further action. While workarounds exist, they are not particularly elegant...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants