Improves drag event handling and scrolling

Refactors drag and drop event handling for smoother updates.

Tracks the current mouse position during drag operations to improve the accuracy of position updates.

Adjusts edge scrolling behavior.
This commit is contained in:
Janus C. H. Knudsen 2025-10-12 23:17:22 +02:00
parent e620c919aa
commit a0344c6143
3 changed files with 9 additions and 6 deletions

View file

@ -84,6 +84,7 @@ export class EdgeScrollManager {
}
private updateMouseY(y: number): void {
// console.log('🖱️ EdgeScrollManager: updateMouseY called', { oldMouseY: this.mouseY, newMouseY: y });
this.mouseY = y;
// Ensure RAF loop is running during drag
if (this.isDragging && this.scrollRAF === null) {
@ -113,7 +114,7 @@ export class EdgeScrollManager {
// Beregn ny position baseret på initial position + total scroll delta
const newTop = this.initialCloneTop + totalScrollDelta;
this.draggedClone.style.top = `${newTop}px`;
//this.draggedClone.style.top = `${newTop}px`;
console.log('📜 EdgeScrollManager: Scroll event - updated clone', {
initialScrollTop: this.initialScrollTop,