Skip to content

Commit

Permalink
feat: add classname in active item of tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeLin committed Jul 15, 2020
1 parent 0445eeb commit 0d1ef24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/tabs/Tabs.tsx
Expand Up @@ -97,8 +97,11 @@ export default class Tabs extends PureComponent<TabsProps, TabsStates> {

renderTabs = (tab: ReactElement<TabPanelProps, typeof TabPanel>, index: number) => {
const { prefixCls, disabled } = this.props;
const { value } = this.state;

const itemCls = classnames(`${prefixCls}__tab`, tab.props.className, {
[`${prefixCls}__tab--disabled`]: disabled || tab.props.disabled,
[`${prefixCls}__tab--active`]: value === index,
});
const isScroll = this.isScroll();
const itemSize = this.calculateItemWidth();
Expand Down Expand Up @@ -215,9 +218,8 @@ export default class Tabs extends PureComponent<TabsProps, TabsStates> {
lineInnerRender = <span className={`${prefixCls}__line__inner`} style={{ width: lineWidth }} />;
}

const headerCls = classnames({
const headerCls = classnames(`${prefixCls}__header`, {
[`${prefixCls}__scroll`]: ChildCount > scrollThreshold!,
[`${prefixCls}__header`]: true,
});

return (
Expand Down

0 comments on commit 0d1ef24

Please sign in to comment.