element icon indicating copy to clipboard operation
element copied to clipboard

[Bug Report] For tables with fixed columns, re-rendering when the horizontal scroll bar disappears, will cause the height of the fixed columns to be calculated incorrectly

Open yxw19870806 opened this issue 4 years ago • 3 comments

Element UI version

2.15.6

OS/Browsers version

Chrome

Vue version

2.6.11

Reproduction Link

https://codepen.io/yxw19870806/pen/BawdvYP

Steps to reproduce

  1. The table has fixed fields
  2. Adjust the size of the browser window, make the table has a horizontal scroll
  3. Maximize the window (you need to ensure that the horizontal scroll bar disappears at this time)

In Reproduction Link, in order to increase the display effect and make it easier to distinguish I set the background-color of .el-table__fixed::before, and .el-table::before

If the table does not have a horizontal scroll before re-render, the problem will not be reproduced And it does not only happen when the size of the browser window changes. If the table data has change make the scroll bar disappears(For example, you reduce the number of table columns), it will have the same effect.

What is Expected?

element-ui will re-render the table, as the scroll bar disappears, the table displays normally

What is actually happening?

The height of the fixed field(class = 'el-table__fixed')is calculated incorrectly In the real project, part of the content of the last row may be obscured

无标题

yxw19870806 avatar Dec 22 '21 03:12 yxw19870806

同样遇到了

WebGhan avatar Mar 22 '22 10:03 WebGhan

同样遇到了,拉滚动条拉不动,被悬浮的列挡住了

pannysp avatar Aug 10 '22 08:08 pannysp

大家好,你们可以使用 "doLayout".

获取数据后添加这代码 (el-table 必须要有 ref="tableRefs") this.$nextTick(() => { this.$refs['tableRefs'].doLayout(); })

https://element.eleme.io/#/en-US/component/table#table-methods

chongkai96 avatar Nov 08 '22 07:11 chongkai96

大家好,你们可以使用 "doLayout".

获取数据后添加这代码 (el-table 必须要有 ref="tableRefs") this.$nextTick(() => { this.$refs['tableRefs'].doLayout(); })

https://element.eleme.io/#/en-US/component/table#table-methods

Issue persists after this

gideonpeters avatar Nov 15 '22 14:11 gideonpeters

大家好,你们可以使用 "doLayout".

获取数据后添加这代码 (el-table 必须要有 ref="tableRefs") this.$nextTick(() => { this.$refs['tableRefs'].doLayout(); })

https://element.eleme.io/#/en-US/component/table#table-methods

It works for me. Nice.

brizer avatar May 18 '23 04:05 brizer