Skip to content

Conversation

yesmeck
Copy link
Member

@yesmeck yesmeck commented Feb 6, 2017

This patch improves table horizontal scroll performance, ant-design/ant-design#4631

@yesmeck yesmeck force-pushed the introcude-component-classes branch from 5bf2e8a to 49e74f5 Compare February 6, 2017 08:38
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 85.714% when pulling 49e74f5 on introcude-component-classes into 9b02b6a on master.

@yesmeck yesmeck force-pushed the introcude-component-classes branch from 49e74f5 to 828ccee Compare February 6, 2017 08:48
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 85.529% when pulling 828ccee on introcude-component-classes into 9b02b6a on master.

src/Table.jsx Outdated
if (this.tableNode) {
const { prefixCls } = this.props;
classes(this.tableNode).remove(new RegExp(`^${prefixCls}-scroll-position-.+$`));
classes(this.tableNode).add(`${prefixCls}-scroll-position-${position}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以链式调用。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

This patch improve table horizontal scroll performance, #4631
className += ` ${prefixCls}-fixed-header`;
}
className += ` ${prefixCls}-scroll-position-${this.state.scrollPosition}`;
className += ` ${prefixCls}-scroll-position-${this.scrollPosition}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一开始会是 undefined 。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这句感觉可以去掉。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里设置了

this.setScrollPosition('left');

要的,第一次渲染的时候要设置 left 的 class。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该说不写的话,一 render 设置的 class 就没了。

@yesmeck yesmeck force-pushed the introcude-component-classes branch from 828ccee to f92e86c Compare February 6, 2017 08:56
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.3%) to 85.714% when pulling f92e86c on introcude-component-classes into 9b02b6a on master.

@yesmeck yesmeck merged commit 8660002 into master Feb 7, 2017
@yesmeck yesmeck deleted the introcude-component-classes branch February 7, 2017 02:40
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

Successfully merging this pull request may close these issues.

3 participants