Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

Prevent animating scroll view on initial mount

Luke Vellaf30505e1f856
diff --git a/components/poll/poll.tsx b/components/poll/poll.tsx
index 54364d9cd..d3e531947 100644
--- a/components/poll/poll.tsx
+++ b/components/poll/poll.tsx
@@ -41,17 +41,19 @@ export const ControlledScrollDiv: React.VoidFunctionComponent<{
className={clsx(" min-w-0 overflow-hidden", className)}
style={{ width: availableSpace, maxWidth: availableSpace }}
>
- <motion.div
- className="flex h-full"
- transition={{
- type: "spring",
- mass: 0.4,
- }}
- initial={{ x: 0 }}
- animate={{ x: scrollPosition * -1 }}
- >
- {children}
- </motion.div>
+ <AnimatePresence initial={false}>
+ <motion.div
+ className="flex h-full"
+ transition={{
+ type: "spring",
+ mass: 0.4,
+ }}
+ initial={{ x: 0 }}
+ animate={{ x: scrollPosition * -1 }}
+ >
+ {children}
+ </motion.div>
+ </AnimatePresence>
</div>
);
};