-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Blazor 5.rc2 Virtualize component scrolling breaks mid scroll in edge and chrome #26870
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
Comments
Thanks for contacting us. |
Hi, I'm having exactly the same issue. I used very simple <Virtualize Context="forecast" ItemsProvider="@LoadData">
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
</Virtualize> Instead of standard
int totalEmployees = 30000;
private async ValueTask<ItemsProviderResult<WeatherForecast>> LoadData(ItemsProviderRequest request)
{
Console.WriteLine($"{request.StartIndex} - {request.Count}");
var numEmployees = Math.Min(request.Count, totalEmployees - request.StartIndex);
var forecast = await Http.GetFromJsonAsync<List<WeatherForecast>>($"WeatherForecast/StartAt/{request.StartIndex}/Take/{numEmployees}");
return new ItemsProviderResult<WeatherForecast>(forecast, totalEmployees);
} And controller: [HttpGet("StartAt/{start:int}/Take/{count:int}")]
public IEnumerable<WeatherForecast> Get(int start, int count)
{
var rng = new Random();
return Enumerable.Range(start, count).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
} Using this, whenever I'm trying to scroll with mouse (or using End key), the view is corrupted in Chrome. It works fine in Firefox. |
What do you mean by “the view is corrupted”? Can you post a screenshot or video? |
Not corrupted, the scroll breaks, its stops scrolling during a drag. And you have to click on the scroll bar caret to begin scrolling again. Basically, you can't click and drag the scroll bars caret/box thing in edge/chrome. |
Is there any chance you could post a video of this happening? I haven’t been able to repro it myself and am looking for clues about what exactly might be happening. |
Hi Steve, Now it's different. Now after scrolling little bit, I cannot see any new items. Either using After using Home and End keys on keyboard few times, it starts to work. I did open console so you can see, that no request is sent upon scrolling at the beginning. You can see my repo here: https://github.com/jakubmaguza/GitHub26870 I did check this on another machine which is Win7, and it's placed in different country. The issue is exactly the same. |
@jakubmaguza Thanks for the video and repro code. What you're seeing there is a known issue - #25915. There is a straightforward workaround for #25915 which is providing an For example, change your use of <Virtualize Context="forecast" ItemsProvider="LoadData" ItemSize="10"> My guess is that @radderz was reporting a different problem, so if anyone is still able to repro that, I'd love to see a video or other clues about what's going on. There is one other known issue in
So far we haven't identified a workaround for that one. Perhaps this is what @radderz was originally reporting but the description does sound a bit different, which is also why I was hoping to see a video of it :) |
@SteveSandersonMS What I did, I add
And now it looks like this: I pushed this change to my repo: https://github.com/jakubmaguza/GitHub26870 |
@jakubmaguza I think your example is still affected by two known issues:
|
I have also seen what @jakubmaguza has seen, the issue I am explaining is a little different. At the start of the below gif, I did normal scroll wheel scrolling, then I start pulling the scroll bar down, and the scrolling breaks part way through, and it stops scrolling without me lifting the mouse. I have to click on it again to start again, but you'll see its breaking alot. The item I tried to recreate the issue, but my layout is a bit more complex with grid based layouts in the real app. When doing this with a simple virtualize panel that is 100% height with overflow-y scroll, I don't seem to get the issue. |
@radderz Thanks for the update. It does look like your issue might be different. We only have a couple of days left for final fixes to 5.0, and the only chance we’d have of fixing your issue would be if we had a repro. Is there any chance you could post code that reproduces that issue? |
Thanks Steve, it looks like mostly it was #26432. This is no longer the case. About 50px row height, my browser did show me 49px, which i used. To be 100% sure, I make change in table row definition:
So now it should fit So now all my browsers are set to English, In firefox scrollbar works perfectly well (right browser), but after switching to edge (or chrome) (left browser), after scrolling half way it is no longer synced with mouse. I pushed those changes to my GitHub: https://github.com/jakubmaguza/GitHub26870 PS: I'm not using any of those 2 browsers for my daily routines, so there are no user specific settings there. |
@jakubmaguza The scroll bar sync issue is the Chromium bug I mentioned above. It’s not Blazor specific - I linked to samples showing the same in React, Angular, and Vue apps. |
That's right, thanks again. Sorry for posting too much. Saying all that, you can find @radderz issue in f.e. angular example you posted, or any page that contains scrollbar. Looks like this is chromium issue. Some of the times, you will find this issue scrolling through list using wheel, and then grabbing scrollbar, but all of the time it is when you are using mouse wheel while hovering mouse over scrollbar. Check here: |
@SteveSandersonMS - I could share with your the full project privately as it's currently just a test of porting our website to Blazor but I wouldn't be able to share that publicly. I wasn't able to recreate the issue using a small project as I am guessing its a combination of things in the overall layout. It's quite possible this isn't specifically a Blazor issue, like @jakubmaguza is saying. As this is not an issue in firefox with the same code. |
Thanks @radderz. If this is something you find is Chromium-specific (doesn't repro in Firefox), and only happens in your project and not in simpler test cases, then there's a high likelihood that it's not a Blazor issue. It might be something really unique about something else going on in your project or might be a general Chromium behavior. Since we've now fixed the definite known issue (#25915) and are already following up with the Edge team about the scrollbar sync glitch, it looks like there's no more direct action we can take on this issue. But if anyone else is able to repro the "scrollbar stops" issue in a way they believe is a Blazor bug, please file a new issue and post repro code! |
Describe the bug
When using the scroll bar in edge (chromium) or chrome the scroll breaks part way through. This doesn't happen in firefox.
To Reproduce
Have a large list of fixed height 100px rows, and try to scroll using the scroll bar, partway through dragging the scroll bar it'll deselect the scroll bar and the scrolling will stop
The text was updated successfully, but these errors were encountered: