Skip to content

Commit

Permalink
fix: TabPane animated display not correct
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Jul 8, 2020
1 parent b075c73 commit 597f6ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/TabPanelList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ export default function TabPanelList({
className={classNames(`${prefixCls}-content`, `${prefixCls}-content-${tabPosition}`, {
[`${prefixCls}-content-animated`]: tabPaneAnimated,
})}
style={activeIndex ? { [rtl ? 'marginRight' : 'marginLeft']: `-${activeIndex}00%` } : null}
style={
activeIndex && tabPaneAnimated
? { [rtl ? 'marginRight' : 'marginLeft']: `-${activeIndex}00%` }
: null
}
>
{tabs.map(tab => {
return React.cloneElement(tab.node, {
Expand Down
1 change: 0 additions & 1 deletion tests/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ exports[`Tabs.Basic Normal 1`] = `
>
<div
class="rc-tabs-content rc-tabs-content-top"
style="margin-left: -100%;"
>
<div
aria-hidden="true"
Expand Down

0 comments on commit 597f6ad

Please sign in to comment.