Repository navigation
fix: [data-view] keep the renderer inside a sized parent - #1029
rohanchkrabrty wants to merge 2 commits into
Conversation
DataView rendered only a context provider, so the toolbar and the renderer were siblings in the consumer's element. The renderer used height: 100% of that element, and overflowed it by the height of the toolbar. DataView now renders a root div (data-slot="data-view") through useRender. It is a flex column with height: 100% and min-width/min-height: 0. The renderers keep height: 100%. As scroll containers they shrink into the height that the toolbar leaves, and they still fill a sized wrapper inside DataView. DataViewProps extends the div props, so className, style, ref and render go to the root.
The root takes width: 100%, so a flex parent that does not stretch its items still gives DataView the full width, as the renderers had before. The renderers take flex: 1, so they fill the height that the other parts leave. A sibling with overflow set, such as a banner between the toolbar and the list, keeps its height. height: 100% stays for a sized wrapper inside DataView. The docs say that the parts are flex items and how custom content scrolls below the toolbar.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
commit: |
Summary
DataViewrendered only a context provider, so the toolbar and the renderer were siblings in your element. The renderer usedheight: 100%of that element and overflowed a fixed-height parent by the height of the toolbar.DataViewnow renders a rootdiv(data-slot="data-view"). It is a flex column withwidth: 100%andheight: 100%. The renderers takeflex: 1and fill the height that the toolbar leaves. They keepheight: 100%, so a sized wrapper insideDataViewstill works.DataViewPropsextends thedivprops throughuseRender, soclassName,style,refandrendergo to the root.upgrading.mdxcover selectors, tests that readcontainer.firstChild, and inline children.data-slot, not bycontainer.firstElementChild. The DataView docs add thedata-viewslot and a note on sizing.Closes #907