Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

DataView: renderer overflows its container by the height of the toolbar

Abierto
#907 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react, typescript

Línea de trabajo

Empieza en data-view.tsx alrededor de la línea 332 y en las reglas .listRoot y .timelineRoot de data-view.module.css; después inspecciona apps/www/src/components/dataview-demo.tsx alrededor de la línea 196 y las demos relacionadas de la documentación. Añade el contenedor de layout compartido y actualiza la prueba estructural, la Slots table y la nota de migración; estará terminado cuando ambos renderizadores permanezcan dentro de contenedores de altura fija, incluida la demo de timeline.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

Put a DataView with a DataView.Toolbar inside a fixed-height container and the renderer spills out of the bottom by exactly the toolbar's height. It has always done this — it only became visible when the docs moved code blocks and demos onto a lighter surface colour, because the overhanging strip is opaque and now paints over what's underneath it.

On /docs/dataview five of the six demos overflow, by 37.5px, 49px, 40px, 41px and 41px. Each figure matches its own toolbar. /docs/dataview/timeline has one at 99px.

Why it happens

DataView renders no DOM of its own — it is a context provider and nothing else (data-view.tsx:332):

return <DataViewContext value={contextValue}>{children}</DataViewContext>;

So DataView.Toolbar and DataView.List end up as siblings inside whatever element the consumer supplies. There is no shared layout box, and the renderer has no way to ask for "the space the toolbar didn't take". Both renderers reach for height: 100% instead:

  • data-view.module.css:132-137 — .listRoot
  • data-view.module.css:351-358 — .timelineRoot

That percentage resolves against the consumer's box, which is also holding the toolbar. Toolbar plus a full-height renderer is always taller than the box by the toolbar's height.

The docs demos hit it because they size the container directly (apps/www/src/components/dataview-demo.tsx:196, and nine more like it):

<div style={{ height: 400 }}>
  <DataView …>
    <DataView.Toolbar>…</DataView.Toolbar>
    <DataView.List variant='table' columns={tableColumns} />

Anyone putting a DataView in a sized box hits the same thing. The toolbar's height is content-driven — it grows when filter chips wrap — so a consumer cannot correct for it by padding their container either.

Suggested approach

Give DataView a layout container and let flexbox do the arithmetic:

return (
  <DataViewContext value={contextValue}>
    <div className={styles.root} data-slot='data-view'>{children}</div>
  </DataViewContext>
);
.root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.listRoot,
.timelineRoot {
  flex: 1;
  min-height: 0;   /* replaces height: 100% */
}

min-height: 0 is the part that matters. A flex item defaults to min-height: auto and refuses to shrink below its content, which is what turns the renderer's own overflow: auto from scrolling into pushing the box open.

This fixes both renderers at once, keeps working when the parent has no fixed height, and means a future renderer gets it for free. The demos' height: 400 wrappers should then work untouched.

Trade-off

It adds a DOM node. Anything relying on the toolbar and renderer being direct children of the consumer's element breaks, so this wants a migration note rather than a patch release. It also needs the data-slot above so it matches the slot convention, a row in the DataView Slots table, and any structural test updated.

Worth ruling out while we're here: documenting "your container must be a flex column" instead of adding the wrapper leaves block containers silently broken, and the failure mode is this same invisible overflow. Subtracting the toolbar with calc() needs a constant we do not have. Measuring the toolbar with a ResizeObserver puts JS on flexbox's job and flashes on first paint.

Lenguaje dominante
TypeScript
Estrellas
69
Forks
13
Merge medio
3 d 15 h
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de raystack/apsara

Todos los issues de raystack/apsara

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.