AllenFang / react-bootstrap-table

A Bootstrap table built with React.js
https://allenfang.github.io/react-bootstrap-table/
MIT License
2.24k stars 783 forks source link

Table header and Table body is not align after updating from version 2.5.7 to 4.3.1 #2113

Open cleforwen opened 4 years ago

cleforwen commented 4 years ago

Hello,

We are using react-bootstrable-table 2.5.7 updating to the latest(4.3.1),

As I dig dipper I look into the library, react-bootstrap-table column width actually computed, and every time the window is resize this will trigger the column width computation

The method is __adjustHeaderWidth, and there is a condition that preventing to compute the width, https://github.com/AllenFang/react-bootstrap-table/blob/master/src/BootstrapTable.js#L1476 if (isScroll || this.isVerticalScroll !== isScroll) {_ but 2.5.7 version without this condition the alignment is fine.

The condition actually is isScroll to check if there is a scroll which is always false(As I check in our case). tbody.parentNode.getBoundingClientRect().height and tbody.parentNode.parentNode.getBoundingClientRect().height has the same value

and isVerticalScroll is initialize to false

Please advise.

Thank you!

DeDX3 commented 2 years ago

I'm facing this exact issue. Did you find any solution for this? Please let me know.