DataView: renderer overflows its container by the height of the toolbar
メンテナーはふだん 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—.listRootdata-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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
raystack/apsara のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
DataView: don't offer select/multiselect filters with empty filterOptions対応中かも @rohanchkrabrty が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 2 日以内に返信
raystack/apsara の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
cameri/nostream#811 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug p3 triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
bug javascript P2-medium python release:v3.1
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
adrirubio/claude-deck#546 ·
メンテナーはふだん 1 日以内に返信
-
area: desktop area: website priority: P2 type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
appandflow/stim#3411 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
rjsf-team/react-jsonschema-form#5485 ·
メンテナーはふだん 2 日以内に返信