Skip to content

Commit

Permalink
fix(progress): improve animation
Browse files Browse the repository at this point in the history
  • Loading branch information
andresz1 committed Aug 28, 2023
1 parent b984f8a commit 5ffcb1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/components/progress/src/ProgressIndicator.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export const progressIndicatorStyles = cva(
{
variants: {
isIndeterminate: {
true: ['absolute', 'origin-left', 'animate-standalone-indeterminate-bar'],
true: ['absolute', '-translate-x-1/2', 'animate-standalone-indeterminate-bar'],
false: [],
},
},
}
},
)

export type ProgressIndicatorStylesProps = VariantProps<typeof progressIndicatorStyles>
2 changes: 1 addition & 1 deletion packages/components/progress/src/ProgressIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const ProgressIndicator = forwardRef<
return (
<ProgressIndicatorPrimitive
className={progressIndicatorStyles({ isIndeterminate, className })}
style={{ ...style, transform: `translateX(-${x}%)` }}
style={{ ...style, ...(!isIndeterminate && { transform: `translateX(-${x}%)` }) }}
ref={ref}
{...others}
/>
Expand Down

0 comments on commit 5ffcb1d

Please sign in to comment.