Skip to content

Commit a3c94e7

Browse files
committed
feat: show all attribute columns with horizontal scroll
The attribute table was truncated to the first 8 properties. Render every property column and size the table to its full width so columns beyond the viewport are reachable via horizontal scrolling.
1 parent 8d7f6a7 commit a3c94e7

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

apps/geolibre-desktop/src/components/panels/AttributeTable.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,14 +266,18 @@ export function AttributeTable() {
266266
for (const k of Object.keys(f.properties)) propKeys.add(k);
267267
}
268268
}
269-
const columns = Array.from(propKeys).slice(0, 8);
269+
const columns = Array.from(propKeys);
270270
const tableColumns = ["__featureId", ...columns];
271271

272272
const columnWidth = (key: SortKey) =>
273273
columnWidths[key] ??
274274
(key === "__featureId"
275275
? DEFAULT_FEATURE_ID_COLUMN_WIDTH
276276
: DEFAULT_ATTRIBUTE_COLUMN_WIDTH);
277+
const tableWidth = tableColumns.reduce(
278+
(width, column) => width + columnWidth(column),
279+
0,
280+
);
277281

278282
const columnWidthLimits = (key: SortKey) =>
279283
key === "__featureId"
@@ -758,7 +762,10 @@ export function AttributeTable() {
758762
Attribute table requires a vector layer.
759763
</p>
760764
) : (
761-
<table className="min-w-full table-fixed caption-bottom text-sm">
765+
<table
766+
className="table-fixed caption-bottom text-sm"
767+
style={{ minWidth: "100%", width: tableWidth }}
768+
>
762769
<colgroup>
763770
{tableColumns.map((col) => (
764771
<col key={col} style={{ width: columnWidth(col) }} />

0 commit comments

Comments
 (0)