fix: 테이블 리사이저 드래그 시 이웃 컬럼 영향 없이 단방향(드래그 방향)으로만 너비가 바뀌도록 개선
All checks were successful
ITAM Code Check / build-and-config-check (push) Successful in 13s
ITAM Docker Build Check / docker-build-check (push) Successful in 37s

This commit is contained in:
이태훈
2026-06-25 17:18:26 +09:00
parent 8747b3946f
commit 8e22c1d713

View File

@@ -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);