Skip to content

Commit

Permalink
fix bug with duration infinitely changing on pause
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrembecky committed Dec 15, 2024
1 parent 4cd5cdd commit df99dc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Marquee/Marquee.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ export const Marquee: FC<MarqueeProps> = ({
width: '100%',
cursor: onClick ? 'pointer' : 'default',

'--duration': `${duration}s`,
// `toFixed` fixes a weird bug with `duration` infinitely changing on pause
'--duration': `${duration.toFixed(4)}s`,
'--delay': `${delay}s`,
'--direction': direction === 'left' ? 'normal' : 'reverse',
'--margin-right': `${marqueeWidth < containerWidth ? containerWidth - marqueeWidth : 0}px`,
Expand Down

0 comments on commit df99dc7

Please sign in to comment.