-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Various virtualization improvements. Fixes #25535 #25260
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
Conversation
This seems a bit quirky. Maybe it is the right design, but I'd be interested to discuss it. What I'm concerned about is that commonly, developers think they know what the item size is, but they are wrong by a small margin of error, perhaps because of the element I understand it's hard to determine the exact height but I'm unsure how bad are the consequences of us getting it wrong by a < 1px fraction or if there are any other approaches you've considered. Let's discuss when possible! |
|
OK, I've been looking into this, and was able to reproduce the problem with fractional heights by using the following test case in @if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<div style="overflow-y: auto; height: 200px; border: 1px solid red;">
<Virtualize Items="forecasts" Context="forecast">
<div style="border: 0.2px solid green" @key="forecast">
<span>@forecast.Date.ToShortDateString()</span>
<span>@forecast.TemperatureC</span>
<span>@forecast.TemperatureF</span>
<span>@forecast.Summary</span>
</div>
</Virtualize>
</div>
}I also changed the underlying data source to supply 500 items. Without your fix that uses Then, after adding your fix that uses So, my remaining two questions are:
|
|
Thanks for the detailed follow-up, @SteveSandersonMS!
I do recall that the
What's funny is that @danroth27 experienced this exact issue, showed me the strange behavior he was getting, and even I didn't initially recognize that the issue was the lack of a |
|
Quick update: It does look like removing the custom rounding logic results in the scrollbar being slightly out of sync with the mouse. I didn't notice any strange behavior when using the scroll wheel, just when clicking and dragging the scrollbar. I think it would be nice to be able to avoid using If we could wrap each item in a |
d6228fb to
84a2c03
Compare
3a000c4 to
f3a2d99
Compare
|
Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge. |
42530e8 to
1f03244
Compare
|
@mkArtakMSFT This is rebased to 5.0-rc2 now. Could you please merge it? |
|
Approved for 5.0 RC2. |
This PR addresses issues with
<Virtualize>:Ask-mode template
@SteveSandersonMS editing the PR description from here:
Description
There are some glitches in the new
Virtualizecomponent that will ship for the first time in RC1:@key, scrolling can get stuck in a loopAdditionally, there wasn't a way to control the number of items fetched to use as a buffer around the visible region, which resulted in no control over the frequency of rendering.
Customer Impact
If we don't merge this, customers will very likely run into one of the above glitches almost immediately. Then they won't be able to try out
<Virtualize>properly and we won't get useful feedback about it or know if our fixes are correct.Regression?
No, this is a new feature
Risk
In the worst case, this might theoretically make
<Virtualize>behave badly in a different as-yet unknown way.Addresses #25535