Skip to content

Commit

Permalink
Fix direction of leaving item (mui#873)
Browse files Browse the repository at this point in the history
Fix incorrect leaving direction of Calendar animation
  • Loading branch information
TrySound authored and dmtrKovalenko committed Jan 22, 2019
1 parent 659f981 commit 3070516
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 29 deletions.
24 changes: 12 additions & 12 deletions lib/.size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"build/dist/material-ui-pickers.esm.js": {
"bundled": 105952,
"minified": 61625,
"gzipped": 14531,
"bundled": 106138,
"minified": 61706,
"gzipped": 14562,
"treeshaked": {
"rollup": {
"code": 48350,
"import_statements": 1294
"code": 48427,
"import_statements": 1312
},
"webpack": {
"code": 55301
"code": 55379
}
}
},
"build/dist/material-ui-pickers.umd.js": {
"bundled": 214636,
"minified": 93497,
"gzipped": 24654
"bundled": 214832,
"minified": 93567,
"gzipped": 24671
},
"build/dist/material-ui-pickers.umd.min.js": {
"bundled": 194864,
"minified": 87812,
"gzipped": 23434
"bundled": 195060,
"minified": 87882,
"gzipped": 23459
}
}
44 changes: 27 additions & 17 deletions lib/src/DatePicker/components/SlideTransition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,33 @@ const SlideTransition: React.SFC<SlideTransitionProps> = ({
children,
transKey,
slideDirection,
}) => (
<TransitionGroup className={clsx(classes.transitionContainer, className)}>
<CSSTransition
key={transKey}
mountOnEnter
unmountOnExit
timeout={animationDuration}
children={children}
classNames={{
enter: classes[`slideEnter-${slideDirection}`],
enterActive: classes.slideEnterActive,
exit: classes.slideExit,
exitActive: classes[`slideExitActiveLeft-${slideDirection}`],
}}
/>
</TransitionGroup>
);
}) => {
const transitionClasses = {
enter: classes['slideEnter-' + slideDirection],
enterActive: classes.slideEnterActive,
exit: classes.slideExit,
exitActive: classes['slideExitActiveLeft-' + slideDirection],
};
return (
<TransitionGroup
className={clsx(classes.transitionContainer, className)}
childFactory={element =>
React.cloneElement(element, {
classNames: transitionClasses,
})
}
>
<CSSTransition
key={transKey}
mountOnEnter
unmountOnExit
timeout={animationDuration}
children={children}
classNames={transitionClasses}
/>
</TransitionGroup>
);
};

(SlideTransition as any).propTypes = {
children: PropTypes.node.isRequired,
Expand Down

0 comments on commit 3070516

Please sign in to comment.