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

在chrome浏览器上,Table固定列遮挡了旁边的列 #9283

Closed
yunxifd opened this issue Feb 7, 2018 · 14 comments
Closed

在chrome浏览器上,Table固定列遮挡了旁边的列 #9283

yunxifd opened this issue Feb 7, 2018 · 14 comments
Assignees

Comments

@yunxifd
Copy link

yunxifd commented Feb 7, 2018

Version

3.2.0

Environment

chrome 63.0.3239.84 ,win10

Reproduction link

https://codesandbox.io/s/24p3xp0z8y

Steps to reproduce

  1. 在chrome上, 点击重现链接
  2. 拖动滚动条
  3. 会看到Column 8列被固定的操作列遮挡了一部分
  4. 用firefox打开,则显示正常

What is expected?

固定列不遮挡旁边的列

What is actually happening?

在chrome上 固定列遮挡了旁边的列

@ant-design-bot
Copy link
Contributor

It will be better to write your issue/comment in English, so more people can understand you.
And this means that more people can help you or benefit from your issue/comment.
See: #4897

@yesmeck
Copy link
Member

yesmeck commented Feb 7, 2018

Set a larger scroll.x

@yunxifd
Copy link
Author

yunxifd commented Feb 7, 2018

设置大点是可以,只是好奇为啥不同浏览器上显示不一样

@hengkx
Copy link
Member

hengkx commented Feb 8, 2018

scroll.x = true
why not?

@yesmeck yesmeck closed this as completed Feb 8, 2018
@yesmeck
Copy link
Member

yesmeck commented Feb 8, 2018

scroll.x should larger than the width of the table.

@fayhy
Copy link

fayhy commented Feb 8, 2018

@yesmeck scroll.x
调整没法很好的解决问题,设置过小会出现遮挡,设置过大会出现没必要的横向滚动条
在数据长度差异较大,但是又想支持各种分辨率的情况下很难设置。。。

issue里的例子

.ant-table-scroll

selector width
table 1160px
table tbody tr 1221px
table tbody tr td:nth-child(2) 58px
table tbody tr td:last-child 74px
table colgroup col:nth-child(2) 100px
table colgroup col:last-child 100px

.ant-table-fixed-left, .ant-table-fixed-right 下对应列都是按照colgroup设置的100px

因为这 42+26px 的差异导致遮挡,Chrome存在这个问题,Firefox 按照100px设置,所以显示正常

在目前的数据长度下,设置 scroll.x 大于等于 1289(1221+42+26) 可以达到理想效果
数据变了,table tbody tr: width 会跟着变
数据长度差异较大的情况下,scroll.x 很难决定一个合理值

尝试的方案

尝试过设置 scroll.x = max-content,可以转换为 style="width: max-content;",Chrome效果理想
scroll.x 是否可以考虑接收类似参数?转换style为 "width: -webkit-max-content; width: -moz-max-content; width: max-content;"
实在不想做样式覆盖啊。。。

@hengkx
scroll.x = true,效果一样,还是会存在遮挡,此时 table tbody tr: width 为 1221px,不是理想的 1289px

@afc163
Copy link
Member

afc163 commented Feb 8, 2018

Try scroll={{ x: '150%' }}

@fayhy
Copy link

fayhy commented Feb 9, 2018

@afc163 I think it's not good enough, the scrollbar always there even if the screen resolution is large enough

@hengkx
Copy link
Member

hengkx commented Feb 9, 2018

这个x的值尝试了 各种 都不能很好的实现,我们现在是动态列宽度 很不好定,不知道 有没有什么好的解决方案

@DuduStyle
Copy link

DuduStyle commented Apr 16, 2018

@afc163 设置了150%依然出现同样地遮挡问题;chrome

@MatchaDog
Copy link

scroll.x = max-content 效果非常理想

@JonathanLee-LX
Copy link
Contributor

scroll.x = max-content 效果非常理想

想了各种方法尝试动态计算表格列的宽度之和,到最后发现还是这个'max-content'效果最好

@Clearives
Copy link

scroll.x = max-content 效果非常理想

想了各种方法尝试动态计算表格列的宽度之和,到最后发现还是这个'max-content'效果最好🤣🤣🤣

@xintianyou
Copy link

想了各种方法尝试动态计算表格列的宽度之和,到最后发现还是这个'max-content'效果最好

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