滚动到列表底部后,angularjs-ui-grid会有多余的空白 [英] angularjs-ui-grid has extra white space after scrolling to the bottom of the list

查看:95
本文介绍了滚动到列表底部后,angularjs-ui-grid会有多余的空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我的ui网格中有足够的行可以滚动时,出于某种原因,列表底部似乎有很多空白.

When I have enough rows in my ui-grid to do scrolling, it seems to have a lot of whitespace at the bottom of the list for some reason.

我已经将其固定在这段代码上(我认为呢?):

I've nailed it down to this piece of code (i think?):

styles['margin-top'] = hiddenRowWidth + 'px';

ui-grid.js的3038行

line 3038 of ui-grid.js

虽然不确定为什么在底部添加了太多空白.有任何想法吗?我以为这是因为我的容器的高度是100%,但即使在特定像素高度下,它似乎也可以做到这一点.

Not sure why it's adding so much white space at the bottom though. Any ideas? I was thinking it's because my container is 100% height, but it seems to do this even with a specific pixel height as well.

edit:好吧,现在我不确定是不是代码的罪魁祸首. ui-grid-canvas元素的高度很大,但仍然不确定为什么.

edit: Well, now I'm not certain that it was that code that's the culprit. The ui-grid-canvas element has a HUGE height, still not sure why.

结束这一点,因为这似乎与CSS相关,这只是我的自定义CSS的问题.

Closing this out, as it seems to be something CSS related that's only a problem for my custom CSS.

推荐答案

我找出了罪魁祸首.

我已经在中添加了padding: 0,因为标题边框和行开头之间的1px间隔确实困扰着我.但是,无论出于何种原因,在尝试处理虚拟化以进行滚动时,这都会中断计算.

I had added padding: 0 to .ui-grid-canvas, because the 1px space between the header border and the start of the rows was really bugging me. However, for whatever reason this breaks the calculations when it's trying to handle virtualization for scrolling.

删除我的自定义填充后,一切似乎都能正常工作.

Upon removing my custom padding, everything seems to work normally.

这篇关于滚动到列表底部后,angularjs-ui-grid会有多余的空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆