mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 09:59:00 +02:00
Prevent animating scroll view on initial mount
This commit is contained in:
parent
7733155746
commit
f30505e1f8
1 changed files with 13 additions and 11 deletions
|
@ -41,17 +41,19 @@ export const ControlledScrollDiv: React.VoidFunctionComponent<{
|
||||||
className={clsx(" min-w-0 overflow-hidden", className)}
|
className={clsx(" min-w-0 overflow-hidden", className)}
|
||||||
style={{ width: availableSpace, maxWidth: availableSpace }}
|
style={{ width: availableSpace, maxWidth: availableSpace }}
|
||||||
>
|
>
|
||||||
<motion.div
|
<AnimatePresence initial={false}>
|
||||||
className="flex h-full"
|
<motion.div
|
||||||
transition={{
|
className="flex h-full"
|
||||||
type: "spring",
|
transition={{
|
||||||
mass: 0.4,
|
type: "spring",
|
||||||
}}
|
mass: 0.4,
|
||||||
initial={{ x: 0 }}
|
}}
|
||||||
animate={{ x: scrollPosition * -1 }}
|
initial={{ x: 0 }}
|
||||||
>
|
animate={{ x: scrollPosition * -1 }}
|
||||||
{children}
|
>
|
||||||
</motion.div>
|
{children}
|
||||||
|
</motion.div>
|
||||||
|
</AnimatePresence>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue