Skip to content
代码片段 群组 项目
提交 2b365304 编辑于 作者: Steve Sanderson's avatar Steve Sanderson
浏览文件

Make virtualization compatible with overflow:scroll on document/body. Fixes #37659

上级 07edd3c1
No related branches found
No related tags found
无相关合并请求
文件被 .gitattributes 条目压制或文件的编码不受支持。
文件被 .gitattributes 条目压制或文件的编码不受支持。
......@@ -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;
}
......
......@@ -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();
}
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册