From 6066c660c681d8a7f0b0e322455244b12e9152e4 Mon Sep 17 00:00:00 2001 From: zombiej Date: Tue, 9 Jun 2020 19:38:42 +0800 Subject: [PATCH] fix: Not show -000% --- src/TabPanelList/index.tsx | 2 +- tests/__snapshots__/index.test.tsx.snap | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/TabPanelList/index.tsx b/src/TabPanelList/index.tsx index 55502a62..e9fda04c 100644 --- a/src/TabPanelList/index.tsx +++ b/src/TabPanelList/index.tsx @@ -31,7 +31,7 @@ export default function TabPanelList({ className={classNames(`${prefixCls}-content`, `${prefixCls}-content-${tabPosition}`, { [`${prefixCls}-content-animated`]: tabPaneAnimated, })} - style={{ [rtl ? 'marginRight' : 'marginLeft']: `-${activeIndex}00%` }} + style={activeIndex ? { [rtl ? 'marginRight' : 'marginLeft']: `-${activeIndex}00%` } : null} > {tabs.map(tab => { return React.cloneElement(tab.node, { diff --git a/tests/__snapshots__/index.test.tsx.snap b/tests/__snapshots__/index.test.tsx.snap index 4f5a1a02..5c33729d 100644 --- a/tests/__snapshots__/index.test.tsx.snap +++ b/tests/__snapshots__/index.test.tsx.snap @@ -165,7 +165,6 @@ exports[`Tabs.Basic Skip invalidate children 1`] = ` >