fix(table): align constrained widths and guard invalid fr factors
This commit is contained in:
@@ -88,9 +88,8 @@ export default defineComponent({
|
||||
const cssWidth = (value: string | number | undefined) => {
|
||||
if (value === undefined) return undefined;
|
||||
if (typeof value === "number") return `${value}px`;
|
||||
// CSS Grid fr units are not valid table widths. Treat Nfr as a flexible
|
||||
// column (native width:auto sharing remaining space). This does not
|
||||
// implement RAC fr weight proportions across columns.
|
||||
// fr is resolved by TableContent after measurement. Leave native layout
|
||||
// untouched until a managed pixel width is available.
|
||||
if (/^\d+(\.\d+)?fr$/.test(value)) return undefined;
|
||||
return value;
|
||||
};
|
||||
@@ -118,7 +117,8 @@ export default defineComponent({
|
||||
? `${resolvedWidth.value}px`
|
||||
: cssWidth(width.value),
|
||||
minWidth: cssWidth(
|
||||
typeof width.value === "number"
|
||||
resolvedWidth.value === undefined &&
|
||||
typeof width.value === "number"
|
||||
? Math.max(props.minWidth ?? 0, width.value)
|
||||
: props.minWidth,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user