Skip to content

Blazor - support variable height items in Virtualize component #25058

@radderz

Description

@radderz

When create a listview of similarly sized items, it's very hard to virtualise this in most web frameworks currently. It'd be great for Blazor to provide an out of the box solution that is able to render a virtual list of items, and account for it's position in the list as items are rendered. Most of my implementations of lists are of items that don't vary in size all that greatly, i.e. an extra line or two of text per item due to some wrapping.

This would need to be able to handle data updates over time, so it shouldn't remember the size of the item when it goes back out of the view port and if the item is in the viewport it should account for the change in size after an update while assuming an approximate size for the not currently visible items.

My concept is to try to have the scroll bar managing the item number through the list rather than the absolute x position, then to show the item at the top that matches closest to that by %, if snapping the items makes this easier that may be an approach.

Basically you'd know the items sizes currently in the viewport, and as the user scrolls, the overall size of the view port would adjust based on the currently visible items actual size + the amount of items above * approx size + the amount of items below * approx size.

This is done well in Xamarin, but that is a non web framework so I guess it's a little easier to control the outcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pillar: Complete Blazor WebPriority:2Work that is important, but not critical for the releaseaffected-fewThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-virtualizationThis issue is related to the Blazor Virtualize componentseverity-majorThis label is used by an internal tool

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions