Skip to content

Virtualize first render has upper spacer #64029

@dariatiurina

Description

@dariatiurina

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When we first render virtualize, the component first loads items from index 1. Because of that the callback for the visible upper spacer is being called and the new load is correctly being called from element 0. This also leads to more calls to ItemsProvider.

Expected Behavior

The first load should work correctly and calculate the items from the index 0 as upper spacer should not be there on the first load.

Steps To Reproduce

  1. Mount the VirtualizationTable.razor.
  2. Put a breakpoint on the callback. (e.g. here)
  3. See how the first component loads elements from the Item 1 on the first load and the upper spacer is visible.

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions