fix: explicitly set left panel + table width during drag for live column reflow

This commit is contained in:
you
2026-03-19 21:01:01 +00:00
parent b98a768da4
commit 4ed043a0ff

View File

@@ -38,15 +38,25 @@
const w = Math.max(280, Math.min(window.innerWidth * 0.7, startW - (e2.clientX - startX)));
panel.style.width = w + 'px';
panel.style.minWidth = w + 'px';
// Force table to reflow with new available width
// Force left panel and table to match new available width
const left = document.getElementById('pktLeft');
if (left) { left.style.overflow = 'hidden'; void left.offsetWidth; left.style.overflow = ''; }
const table = document.getElementById('pktTable');
if (left && table) {
const available = left.parentElement.clientWidth - w;
left.style.width = available + 'px';
table.style.width = available + 'px';
}
}
function onUp() {
handle.classList.remove('dragging');
document.body.style.cursor = '';
document.body.style.userSelect = '';
localStorage.setItem(PANEL_WIDTH_KEY, panel.offsetWidth);
// Clear forced widths, let flex take over
const left = document.getElementById('pktLeft');
const table = document.getElementById('pktTable');
if (left) left.style.width = '';
if (table) table.style.width = '';
document.removeEventListener('mousemove', onMove);
document.removeEventListener('mouseup', onUp);
}