Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

107
Vistas
Framer Motion scroll based on array push

I have a container that shows every card inside the cards array. The problem is that I can't seem to make the container scroll to the new card whenever the cards array is appended. What happens is that it does scroll, but only to the last card on the array, and not the new card.

<AnimatePresence>
  <div id="scrollContainer" scrollableX>
    {
      cards.length && cards.map(card =>
         // The Card component is a motion.div
         <Card/>
      )
    }     
  </div>
</AnimatePresence>

I have tried using scrollLeft on Javascript, but it only scrolls to the last card (the card before the newest card). The code was:

const container = document.getElementById("scrollContainer");
container.scrollLeft = container.scrollWidth;
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda