Browse Source

card type Tab should not have any animation

pull/5801/head
afc163 8 years ago
parent
commit
6e147b7a3d
  1. 4
      components/tabs/index.tsx
  2. 11
      components/tabs/style/card-style.less
  3. 1
      components/tabs/style/index.less

4
components/tabs/index.tsx

@ -107,6 +107,10 @@ export default class Tabs extends React.Component<TabsProps, any> {
inkBarAnimated: animated, tabPaneAnimated: animated,
};
if (type !== 'line') {
tabPaneAnimated = false;
}
warning(
!(type.indexOf('card') >= 0 && size === 'small'),
'Tabs[type=card|editable-card] doesn\'t have small size, it\'s by designed.',

11
components/tabs/style/card-style.less

@ -28,10 +28,10 @@
transform: translateZ(0);
border-color: @border-color-base;
color: @primary-color;
}
&&-card > &-bar &-tab-active {
padding-bottom: 5px;
transform: translateZ(0);
}
&&-card > &-bar &-tab-inactive {
padding: 0;
}
&&-card > &-bar &-nav-wrap {
margin-bottom: 0;
@ -52,6 +52,11 @@
}
}
&&-card &-content > &-tabpane,
&&-editable-card &-content > &-tabpane {
transition: none!important;
}
&&-editable-card > &-bar &-tab > div {
transition: all 0.3s @ease-in-out;
}

1
components/tabs/style/index.less

@ -202,6 +202,7 @@
> .@{tab-prefix-cls}-tabpane-inactive {
opacity: 0;
height: 0;
padding: 0!important;
}
}
> .@{tab-prefix-cls}-content-animated {

Loading…
Cancel
Save