Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#907 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react, typescript

調査の方向性

data-view.tsx の 332 行目付近と、data-view.module.css の .listRoot および .timelineRoot ルールから始め、続いて apps/www/src/components/dataview-demo.tsx の 196 行目付近と関連するドキュメントのデモを調べます。共有レイアウトコンテナを追加し、構造テスト、Slots table、移行に関する注記を更新します。両方のレンダラーが timeline のデモを含め、固定高さのコンテナ内に収まれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
69
フォーク
13
平均マージ
3日 15時間
マージ済み PR(30日)
24

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

raystack/apsara のほかの issue

raystack/apsara の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。