From 019b3cf4da0903aa0e0f344714b9ac73366fed79 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 3 Feb 2026 15:50:48 -0500 Subject: [PATCH] feature/IO-3548-Bill-Modal-TabOrder --- .../production-list-table.component.jsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/client/src/components/production-list-table/production-list-table.component.jsx b/client/src/components/production-list-table/production-list-table.component.jsx index 64e07d1f5..87448b68c 100644 --- a/client/src/components/production-list-table/production-list-table.component.jsx +++ b/client/src/components/production-list-table/production-list-table.component.jsx @@ -92,6 +92,8 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici const [activeId, setActiveId] = useState(null); + const MIN_COL_WIDTH = 20; + const sensors = useSensors( useSensor(PointerSensor, { activationConstraint: { @@ -144,6 +146,12 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici const [state, setState] = useState(initialStateRef.current); const [columns, setColumns] = useState(initialColumnsRef.current); + const scrollX = useMemo(() => { + // keep scroll width aligned with the actual column widths so AntD doesn't clamp at a fixed floor + const sum = columns.reduce((acc, c) => acc + (c.width ?? 100), 0); + return Math.max(sum, 1); + }, [columns]); + const { t } = useTranslation(); const matchingColumnConfig = useMemo(() => { @@ -243,15 +251,16 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici // NEW: commit widths via rAF (less jank) const applyColumnWidth = useCallback((columnKey, width) => { + const nextWidth = Math.max(MIN_COL_WIDTH, Math.round(width)); setColumns((prev) => { const idx = prev.findIndex((c) => c.key === columnKey); if (idx === -1) return prev; const currentWidth = prev[idx].width ?? 100; - if (currentWidth === width) return prev; + if (currentWidth === nextWidth) return prev; const next = prev.slice(); - next[idx] = { ...next[idx], width }; + next[idx] = { ...next[idx], width: nextWidth }; return next; }); }, []); @@ -524,7 +533,7 @@ export function ProductionListTable({ loading, data, refetch, bodyshop, technici rowKey="id" loading={loading} dataSource={dataSource} - scroll={{ x: 1000 }} + scroll={{ x: scrollX }} onChange={handleTableChange} />