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

127
Vistas
ResizeObserver not being triggered on add & remove

I have a chat application which appends messages to the bottom, and when a limit is reached, it removes the oldest message. So it adds and removes a message at the same time. I'm using the ResizeObserver to detect changes in the chat area.

Hue.chat_resize_observer = new ResizeObserver(function () {
  Hue.goto_bottom()
})

Hue.chat_resize_observer.observe(Hue.el("#chat_area"))
Hue.chat_resize_observer.observe(Hue.el("#chat_area_parent"))

The issue I'm having is that the observer simply doesn't get triggered on some messages, and my guess is because the message being inserted is the same height as the message that got removed. How could I get around this? Or maybe I could use another observer? I use the ResizeObserver because it takes into account all height changes, for instance on message added/removed or message height change. I'm thinking I could pair it with the MutationObserver or use setTimeout's but those doesn't seem like ideal solutions.

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