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

197
Vistas
Why borderBoxSize of ResizeObserver is a Array

When i Use ResizeObserver i Create a ObserverCallBack like

public handleCallBack: ResizeObserverCallback = entries => {
    entries.forEach(entry => {
    // get new size
    const newWidth = entry.borderBoxSize.inlineSize
    })
}

But the type of borderBoxSize is ReadonlyArray of ResizeObserverSize

I should change my code to be borderBoxSize[0]

I'm very curious why borderBoxSize need to be an Array, and when it's length will be larger then 1

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

According to the note at https://drafts.csswg.org/resize-observer/#dom-resizeobserverentry-borderboxsize it can't happen yet, but will in a future version of the specs:

The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments, which occur in multi-column scenarios. However the current definitions of content rect and border box do not mention how those boxes are affected by multi-column layout. In this spec, there will only be a single ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column. A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.

about 4 years ago · Juan Pablo Isaza Denunciar
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