diff --git a/src/Components/Web.JS/dist/Release/blazor.server.js b/src/Components/Web.JS/dist/Release/blazor.server.js index 8c06e6b07c5fdc55f40ac5e91d0770fa2b156be3..c6266f1eed7b19f580f2053a1732b9f4216a5d30 100644 Binary files a/src/Components/Web.JS/dist/Release/blazor.server.js and b/src/Components/Web.JS/dist/Release/blazor.server.js differ diff --git a/src/Components/Web.JS/dist/Release/blazor.webview.js b/src/Components/Web.JS/dist/Release/blazor.webview.js index 860bcf1e39740e997697de088fba98df4fd72b37..98fe283cd37cb5b2b9e71d2bac623243e5461024 100644 Binary files a/src/Components/Web.JS/dist/Release/blazor.webview.js and b/src/Components/Web.JS/dist/Release/blazor.webview.js differ diff --git a/src/Components/Web.JS/src/Virtualize.ts b/src/Components/Web.JS/src/Virtualize.ts index a6603f25fdd48a8d3bdd50136e52c1396683c322..2fcd0f1d1cbb29b31e867f15c46756da3785f160 100644 --- a/src/Components/Web.JS/src/Virtualize.ts +++ b/src/Components/Web.JS/src/Virtualize.ts @@ -9,7 +9,11 @@ export const Virtualize = { const observersByDotNetId = {}; function findClosestScrollContainer(element: HTMLElement | null): HTMLElement | null { - if (!element) { + // If we recurse up as far as body or the document root, return null so that the + // IntersectionObserver observes intersection with the top-level scroll viewport + // instead of the with body/documentElement which can be arbitrarily tall. + // See https://github.com/dotnet/aspnetcore/issues/37659 for more about what this fixes. + if (!element || element === document.body || element === document.documentElement) { return null; } diff --git a/src/Components/test/testassets/BasicTestApp/VirtualizationTable.razor b/src/Components/test/testassets/BasicTestApp/VirtualizationTable.razor index 8a357e526e6854fa736f77e8666f09971b52e0b1..a928ec80894566e35e611f4bd80b9fe397b57c5b 100644 --- a/src/Components/test/testassets/BasicTestApp/VirtualizationTable.razor +++ b/src/Components/test/testassets/BasicTestApp/VirtualizationTable.razor @@ -18,6 +18,11 @@ </tbody> </table> +<style> + /* Represents https://github.com/dotnet/aspnetcore/issues/37659 */ + html, body { overflow-y: scroll } +</style> + @code { List<int> fixedItems = Enumerable.Range(0, 1000).ToList(); }