diff --git a/src/views/List/ListFactory.ts b/src/views/List/ListFactory.ts index c7ae6b0..65ad759 100644 --- a/src/views/List/ListFactory.ts +++ b/src/views/List/ListFactory.ts @@ -709,11 +709,19 @@ export function createListView(container: HTMLElement, config: ListViewConfig) { let startX = 0; let startWidth = 0; + let startTableWidth = 0; const onMouseMove = (e: MouseEvent) => { const dx = e.clientX - startX; const newWidth = Math.max(50, startWidth + dx); + + // Update the width of the dragged column th.style.width = `${newWidth}px`; + + // Dynamically adjust the total table width by the delta change, + // preventing neighboring columns from shrinking or expanding. + const deltaW = newWidth - startWidth; + tableElement.style.width = `${startTableWidth + deltaW}px`; }; const onMouseUp = () => { @@ -729,6 +737,9 @@ export function createListView(container: HTMLElement, config: ListViewConfig) { startX = e.clientX; startWidth = th.offsetWidth; + + // Capture the initial physical width of the entire table + startTableWidth = tableElement.offsetWidth; resizer.classList.add('resizing'); document.addEventListener('mousemove', onMouseMove);