Skip to content
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

当表格出现滚动条时的一些问题 #17

Open
allen-allin opened this issue Dec 7, 2017 · 0 comments
Open

当表格出现滚动条时的一些问题 #17

allen-allin opened this issue Dec 7, 2017 · 0 comments

Comments

@allen-allin
Copy link

allen-allin commented Dec 7, 2017

您好!这个库对我来说非常有帮助,感谢分享!但是在使用的时候发现一些问题:

  1. 当表格数据量过多时会出现滚动条,这时拖动过程中表格的宽高会向右向下延伸到屏幕尽头,研究了一下可能是因为拖动的时候对新生成的 .sindu_dragger这个元素只做了位置的处理而没有做宽高的处理,无法使它的大小和原表格保持一致。我在源码的2522行后增加了两行代码,情况会好一些,但仍期望官网能改善一下
     //  原代码块
	   (0, _util.css)(el, {
	        position: 'absolute',
	        top: originEl.offsetTop + 'px',
                left: originEl.offsetLeft + 'px',
	    });
     //  我修改后
	   (0, _util.css)(el, {
	        position: 'absolute',
	        top: originEl.offsetTop + 'px',
                left: originEl.offsetLeft + 'px',
                width: originEl.parentNode.offsetWidth + 'px',
                height: originEl.parentNode.offsetHeight + 'px'
	    });
  1. 拖动时表格的背景会变成红色,个人感觉将源码中第113行中的red改为rgba(255,255,255,0.2)会好一点
  2. 建议在有滚动条的情况下,拖动的行或者列的宽高应该和原始行或者列的宽高保持一致,否则镜像元素会比原始元素还要宽(高),超出了table的容器。建议将源码中的._mirror元素的overflow设置为hidden(3169行),如下
 _mirror.style.overflow = 'hidden';
 _mirror.style.width = _item.parentNode.offsetWidth + 'px';
 _mirror.style.height = _item.parentNode.offsetHeight + 'px' ;
  1. 建议有滚动条的情况下,当拖动的行或者列超出table的容器时,滚动条可以跟着滚动,松开鼠标后该行或者列的位置应该是最终的滚动位置
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant