Skip to content

Commit

Permalink
fix: Tabs missing slide motion def (#38892)
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Nov 23, 2022
1 parent 5d9cb2e commit c2f75a2
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions components/tabs/style/motion.tsx
@@ -1,40 +1,46 @@
import type { TabsToken } from '.';
import { initSlideMotion } from '../../style/motion';
import type { GenerateStyle } from '../../theme/internal';

const genMotionStyle: GenerateStyle<TabsToken> = (token) => {
const { componentCls, motionDurationSlow } = token;

return {
[componentCls]: {
[`${componentCls}-switch`]: {
'&-appear, &-enter': {
transition: 'none',
return [
{
[componentCls]: {
[`${componentCls}-switch`]: {
'&-appear, &-enter': {
transition: 'none',

'&-start': {
opacity: 0,
'&-start': {
opacity: 0,
},
'&-active': {
opacity: 1,
transition: `opacity ${motionDurationSlow}`,
},
},
'&-active': {
opacity: 1,
transition: `opacity ${motionDurationSlow}`,
},
},

'&-leave': {
position: 'absolute',
transition: 'none',
inset: 0,
'&-leave': {
position: 'absolute',
transition: 'none',
inset: 0,

'&-start': {
opacity: 1,
},
'&-active': {
opacity: 0,
transition: `opacity ${motionDurationSlow}`,
'&-start': {
opacity: 1,
},
'&-active': {
opacity: 0,
transition: `opacity ${motionDurationSlow}`,
},
},
},
},
},
};

// Follow code may reuse in other components
[initSlideMotion(token, 'slide-up'), initSlideMotion(token, 'slide-down')],
];
};

export default genMotionStyle;

0 comments on commit c2f75a2

Please sign in to comment.