Skip to content

Commit

Permalink
refactor(material): allow auto value
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed May 2, 2022
1 parent 2a0a505 commit 7a9523f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/material/src/transitions/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface ComponentProps {
"transitionDuration" | "transitionTimingFunction" | "transitionDelay"
>
| undefined;
timeout: number | { enter?: number; exit?: number };
timeout: number | "auto" | { enter?: number; exit?: number };
}

interface Options {
Expand All @@ -32,7 +32,11 @@ export function getTransitionProps(
return {
duration:
style.transitionDuration ??
(typeof timeout === "number" ? timeout : timeout[options.mode] || 0),
(typeof timeout === "number"
? timeout
: typeof timeout === "string"
? 0
: timeout[options.mode] || 0),
easing:
style.transitionTimingFunction ??
(typeof easing === "object" ? easing[options.mode] : easing),
Expand Down

0 comments on commit 7a9523f

Please sign in to comment.