Skip to content

Commit

Permalink
fix: typo in carousel calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 committed Aug 7, 2024
1 parent 98c8b4c commit c443608
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/ui/SnapCarousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const SnapCarousel = ({

const itemWidth = useMemo(() => {
const total = ref.current?.scrollWidth ?? 0;
return total - (startPadding + endPadding + gap * (itemLength - 1)) / itemLength;
return (total - (startPadding + endPadding + gap * (itemLength - 1))) / itemLength;
}, [ref.current?.scrollWidth, itemLength, gap, startPadding, endPadding]);

const onScroll = (e: React.UIEvent<HTMLDivElement>) => {
Expand Down

0 comments on commit c443608

Please sign in to comment.