Skip to content

Commit

Permalink
fix(Table): style confusion caused by vertical scrollbar, close #473
Browse files Browse the repository at this point in the history
  • Loading branch information
youluna committed Mar 22, 2019
1 parent 70c1bc4 commit 9149879
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/table/fixed.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ export default function fixed(BaseComponent) {
}

adjustFixedHeaderSize() {
const { hasHeader, fixedHeader, maxBodyHeight } = this.props;
const { hasHeader, fixedHeader, maxBodyHeight, rtl } = this.props;
const paddingName = rtl ? 'paddingLeft' : 'paddingRight';

if (hasHeader && fixedHeader && !this.props.lockType) {
if (this.bodyNode.scrollHeight <= maxBodyHeight) {
dom.setStyle(this.headerNode, 'paddingRight', 0);
dom.setStyle(this.headerNode, paddingName, 0);
} else {
dom.setStyle(
this.headerNode,
'paddingRight',
paddingName,
dom.scrollbar().width
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/table/lock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export default function lock(BaseComponent) {
dom.setStyle(
lockRightBodyWrapper,
rtl ? 'left' : 'right',
width
`${width}px`
);
}
}
Expand Down

0 comments on commit 9149879

Please sign in to comment.