From c2f75a2ba3054f67041810aa8d172ab5965b21b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Wed, 23 Nov 2022 23:56:24 +0800 Subject: [PATCH] fix: Tabs missing slide motion def (#38892) --- components/tabs/style/motion.tsx | 52 ++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/components/tabs/style/motion.tsx b/components/tabs/style/motion.tsx index 88f9a1a62f8f..d011082b7197 100644 --- a/components/tabs/style/motion.tsx +++ b/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 = (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;