Skip to content

Commit

Permalink
fix(Table): style confusion caused by vertical scrollbar, close aliba…
Browse files Browse the repository at this point in the history
  • Loading branch information
youluna committed Mar 22, 2019
1 parent 70c1bc4 commit 530da7f
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions src/table/fixed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,26 @@ export default function fixed(BaseComponent) {
}

adjustFixedHeaderSize() {
const { hasHeader, fixedHeader, maxBodyHeight } = this.props;
if (hasHeader && fixedHeader && !this.props.lockType) {
if (this.bodyNode.scrollHeight <= maxBodyHeight) {
dom.setStyle(this.headerNode, 'paddingRight', 0);
} else {
const { hasHeader, fixedHeader, maxBodyHeight, rtl } = this.props;
const paddingDir = rtl ? 'paddingLeft' : 'paddingRight';

if (hasHeader && fixedHeader) {
// adjust header of basic_table
if (!this.props.lockType) {
if (this.bodyNode.scrollHeight <= maxBodyHeight) {
dom.setStyle(this.headerNode, 'paddingRight', 0);
} else {
dom.setStyle(
this.headerNode,
paddingDir,
dom.scrollbar().width
);
}
// adjust body of lock_right_table
} else if (this.props.lockType === 'right') {
dom.setStyle(
this.headerNode,
'paddingRight',
this.bodyNode,
paddingDir,
dom.scrollbar().width
);
}
Expand Down

0 comments on commit 530da7f

Please sign in to comment.