From a7289db621d0d93a36aecff5ca40dcfef6caec12 Mon Sep 17 00:00:00 2001 From: bruno Date: Wed, 22 Jul 2026 16:32:41 -0400 Subject: [PATCH] fix(database): column resize uses direct coordinate calculation Replace delta-based approach with direct mouse-position-to-column-edge calculation: newW = ev.clientX - thLeft. No setPointerCapture needed, no coordinate drift. --- app/templates/_database_table_scripts.html | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/templates/_database_table_scripts.html b/app/templates/_database_table_scripts.html index 8bc5dbe..1c5b8bd 100644 --- a/app/templates/_database_table_scripts.html +++ b/app/templates/_database_table_scripts.html @@ -165,15 +165,13 @@ handle.onpointerdown = function(e) { e.preventDefault(); e.stopPropagation(); - this.setPointerCapture(e.pointerId); const propId = parseInt(this.dataset.propId); const th = this.parentElement; - const startX = e.clientX; - const startW = th.getBoundingClientRect().width; + const thLeft = th.getBoundingClientRect().left; function onMove(ev) { - const diff = ev.clientX - startX; - const newW = Math.max(60, startW + diff); + // Calculate width directly from mouse position relative to th left edge + const newW = Math.max(60, ev.clientX - thLeft); state.colWidths[propId] = newW; th.style.width = newW + 'px'; th.style.minWidth = newW + 'px'; @@ -185,8 +183,7 @@ }); } } - function onUp(ev) { - handle.releasePointerCapture(ev.pointerId); + function onUp() { document.removeEventListener('pointermove', onMove); document.removeEventListener('pointerup', onUp); document.body.style.cursor = '';