Skip to content

Commit

Permalink
fix: table fill width bug
Browse files Browse the repository at this point in the history
  • Loading branch information
skokenes committed Nov 14, 2024
1 parent 9542a5d commit 4a167cc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/malloy-render/src/component/table/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,14 @@ const MalloyTableRoot = (_props: {
const props = mergeProps({rowLimit: Infinity}, _props);
const tableCtx = useTableContext()!;
const resultMetadata = useResultContext();
const shouldFillWidth =
typeof props.shouldFillWidth === 'boolean'
? props.shouldFillWidth
: tableCtx.root &&
props.data.field.tagParse().tag.tag('table')?.text('size') === 'fill';

let shouldFillWidth = false;
if (tableCtx.root) {
const sizeTag = props.data.field.tagParse().tag.tag('table')?.tag('size');
if (sizeTag && sizeTag.text() === 'fill') shouldFillWidth = true;
else if (typeof props.shouldFillWidth === 'boolean')
shouldFillWidth = props.shouldFillWidth;
}

const pinnedFields = createMemo(() => {
const fields = Object.entries(tableCtx.layout.fieldHeaderRangeMap)
Expand Down

0 comments on commit 4a167cc

Please sign in to comment.