Skip to content

Commit 3a000c4

Browse files
Apply overflow anchor fix to document element too
1 parent 84a2c03 commit 3a000c4

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/dist/Release/blazor.webassembly.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/src/Virtualize.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ function init(dotNetHelper: any, spacerBefore: HTMLElement, spacerAfter: HTMLEle
2323
// Overflow anchoring can cause an ongoing scroll loop, because when we resize the spacers, the browser
2424
// would update the scroll position to compensate. Then the spacer would remain visible and we'd keep on
2525
// trying to resize it.
26-
const scrollContainer = findClosestScrollContainer(spacerBefore);
27-
if (scrollContainer) {
28-
scrollContainer.style.overflowAnchor = 'none';
29-
}
26+
const scrollContainer = findClosestScrollContainer(spacerBefore) || document.documentElement;
27+
scrollContainer.style.overflowAnchor = 'none';
3028

3129
const intersectionObserver = new IntersectionObserver(intersectionCallback, {
3230
root: scrollContainer,

0 commit comments

Comments
 (0)