Hello Syncfusion Team,
I'm currently working with the Virtualization feature in the Dropdown List, using the code example provided in your documentation here: Dropdown List Virtualization Documentation.
Here’s the code I’m using:
@using Syncfusion.Blazor.DropDowns
@using Syncfusion.Blazor.Data
<SfDropDownList TValue="string" TItem="Record" Placeholder="Select an item" DataSource="@Records" Query="@LocalDataQuery" PopupHeight="130px" EnableVirtualization="true">
<DropDownListFieldSettings Text="Text" Value="ID"></DropDownListFieldSettings>
</SfDropDownList>
@code{
public Query LocalDataQuery = new Query().Take(6);
public class Record
{
public string ID { get; set; }
public string Text { get; set; }
}
public List<Record> Records { get; set; }
protected override void OnInitialized()
{
this.Records = Enumerable.Range(1, 150).Select(i => new Record()
{
ID = i.ToString(),
Text = "Item " + i,
}).ToList();
}
}
I am encountering the following issue:
Steps to Reproduce:
Expected Behavior:
When scrolling up, I would like the dropdown to display all previously loaded items without needing to re-load them, thus avoiding the white background issue. For example, if my dropdown has 700 items, it should initially load and display 50 items. As I scroll down, it should load an additional 50 items at a time (from items 50–100, then 100–150, etc.). By the time I have scrolled down to load 150 items, I expect that when I scroll back up, items 1–150 will already be available without any additional loading or UI glitches.
I have two questions:
DropDownTreeField has a Query property but lacks an EnableVirtualization property.Hi Tien Pham,
Query1: "Is there a way to resolve the UI glitch (the white background) described above when using the Dropdown List with virtualization?"
Thank you for reaching out to us. We have created a sample based on the code snippet you shared, and we observed that the items are loaded properly in the popup when scrolling down and back to the top. Please refer to the video illustration below for a better understanding:
Sample: https://blazorplayground.syncfusion.com/hjLfMsifpfIwXSIs
To assist you further, could you please share the syncfusion package version and steps to replicate the issue or provide a sample that reproduces the issue? This will help us investigate the issue more effectively.
We appreciate your understanding and cooperation.
Query2: "Can the Virtualization feature be enabled for the Dropdown Tree component? I noticed the DropDownTreeField has a Query property but lacks an EnableVirtualization property."
For this query, we have created a new forum thread to assist you further. Please follow the link below for additional help:
Request for Support in Dropdown Tree - from 195145 | Blazor Forums | Syncfusion
Regards,
Priyanka K
Hi Priyanka Karthikeyan,
Thank you for the sample and video. I’m currently using Syncfusion Blazor version 27.1.48, which I believe is relatively recent. After closely reviewing your video, I think the white background issue does appear, though it’s subtle due to the default white background color. To better illustrate, I recorded a video with a modified background color to make this issue more noticeable. Since I couldn't upload the video directly, I have attached it as a .zip file for you to review.
I now have three additional questions based on my observations:
I believe I noticed an HTML element with a white background being applied. Could you help identify which element is setting the background to white in this instance?
What role does this white background play in Virtualization? Is it intended as a loading indicator, a bug, or simply part of the default styling? If possible, could you advise if there is a way to override or remove this white background using CSS?
In my usage (as shown in the video), I wait for items to fully render and scroll down. However, upon scrolling back up, skeleton loading appears for items that were previously loaded. This affects the user experience, as it forces unnecessary re-loading of content that should already be in view. Is there a solution to ensure these previously loaded items remain available without needing to re-load?
Thank you for your assistance, and I look forward to your guidance.
Best regards,
Tien Pham
Hi Tien Pham,
Query1: "I believe I noticed an HTML element with a white background being applied. Could you help identify which element is setting the background to white in this instance?"
Thank you for bringing this to our attention. We have escalated the reported issue to the concerned team for further investigation. We will be able to provide you with more details tomorrow. We appreciate your patience and understanding during this time.
Query2: "However, upon scrolling back up, skeleton loading appears for items that were previously loaded. This affects the user experience, as it forces unnecessary re-loading of content that should already be in view. Is there a solution to ensure these previously loaded items remain available without needing to re-load?"
Thank you for your update. Currently, the component does not retain previously loaded items; instead, only the list items that are visible in the current scrolled position are appended to the DOM. This approach is particularly useful for handling large datasets, as it ensures that only a fixed number of DOM elements are created at any given time. When scrolling through the list, the existing DOM elements are reused to display the relevant data, rather than generating new elements for each item, which helps manage performance efficiently. This recycling process is handled internally by the component.
As a result, when scrolling back, previously loaded items are fetched again, causing the skeleton loading to appear. This behavior is part of the component’s default mechanism.
We truly appreciate your understanding and cooperation regarding this matter. Please don't hesitate to reach out if you need further clarification or assistance.
Regards,
Priyanka K
Hi Tien Pham,
We have considered this issue "White Background appears suddenly when we scroll back to the top position" as a bug from our end, and the fix for the issue will be included on Volume4 release which is expected to be scheduled on mid of december 2024.
You can now track the status of the feedback through the below link,
Feedback link:https://www.syncfusion.com/feedback/63413/white-background-appears-suddenly-when-we-scroll-back-to-the-top-position
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Regards,
Priyanka K
Okay, thank you. Please notify me when the issues have been fixed.
Hi Tien Pham,
We have included the fix for the issue “White Background appears suddenly when we scroll back to the top position” with our package version “28.1.36”. Therefore, we recommend upgrading to our latest version to resolve the current issue.
Sample: https://blazorplayground.syncfusion.com/VjBzsrBTLZnKvgoK
Rootcause:
When the startIndex reaches 0 during upward scrolling, the transform adjustment logic fails to update properly, causing the virtual content to remain misaligned.The missing alignment causes a "gap" between the scroll container and the virtual content, which results in the visible white background.
Regards,
Priyanka K