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

自定义浏览器滚动条并且设置 scroll.y 时,如果数据内容较少,右侧仍旧会出现填充列。 #998

Open
promise96319 opened this issue Jun 12, 2023 · 3 comments

Comments

@promise96319
Copy link

问题复现地址:

https://stackblitz.com/edit/react-ytlq4p?file=index.css,demo.tsx,index.tsx

问题描述:

当自定义浏览器滚动条时,并且设置 scroll.y,此时 rc-table 会在表头自动添加一列 xxx-cell-scrollbar,用于与自定义滚动条对齐。

但是当表格的数据量比较小时,表格内并没有出现滚动,还是会添加 xx-cell-scrollbar 列,并且表格内部会设置 overflow: scroll,样式会显得比较奇怪,如下:

image

期望:

希望能在表格内部未出现滚动的情况下,不自动添加该 scrollbar 列,并且 body 样式设置为 overflow: auto。

一点想法:

默认情况下不添加 scrollbar 列,用 rc-resize-observer 监听 body 是否滚动,渲染完成后,根据滚动状态来决定是否添加 scrollbar 列。

@NickJiangDev
Copy link

同样的问题我们也遇到了,希望给到一个解决的方法

@NickJiangDev
Copy link

@zombieJ

@BanShan-Alec
Copy link

ant-design/ant-design#47777 (comment)
需要自行监听是否滚动条

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

3 participants