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

183
Vistas
How can I see what triggered a ResizeObserverCallback?

I'm running into a recursive loop with a ResizeObserver, where something inside the observed container is changing the size of the container on re-render, which causes the ResizeObserver to re-trigger.

In this specific case, there are several items I suspect may be causing this, but haven't been able to pinpoint what causes it. Using the DevTools debugger, I'm able to see the ResizeObserver is triggered, but the Stack trace is empty.

There's a good chance it's caused by Javascript, but an equally good chance it's caused by some part of the css layout, which would not be stack trace-able.

Is there some way to see why the ResizeObserver is called?

The callback includes the target, but the target is the observed object, not the originally changed object. A minimal reproduction can be found here- https://jsfiddle.net/jamessw/5czoyws6/44/

  <div id="observed">
    <div id="changed">
      This is short text that will get long
    </div>
  </div>
  <br /><br />
  <div id="output">
    Entry target id:
  </div>
  <button id="changeButton">
    Change
  </button>
const resizeObserver = new ResizeObserver(entries => {
  for (let entry of entries) {
    const output = document.getElementById('output');
    output.innerHTML += entry.target.id + ' ';
  }
});
const element = document.getElementById('observed')
resizeObserver.observe(element);

const button = document.getElementById('changeButton');
button.addEventListener('click', () => {
  const changed = document.getElementById('changed');
  changed.innerHTML += ' foo'
})
#observed{
  float: left;
  overflow: auto;
}
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