fix(dashboard): prevent drag when clicking resize handles or controls
- Add event target check in DragDropHandler to ignore resize handles - Add event target check to ignore widget edit controls - Use e.target.closest() to check parent elements - Add e.stopPropagation() in resize handle event handlers - Replace simplified ResizeHandler with fully functional version - Now resize handles work correctly without triggering drag - Both mouse and touch events properly handled - Fixes integration issue where resizing always triggered dragging
This commit is contained in:
@@ -58,11 +58,22 @@ export class DragDropHandler {
|
||||
|
||||
const mouseDownHandler = (e) => {
|
||||
if (e.button !== 0) return; // Only left mouse button
|
||||
|
||||
// Don't drag if clicking on resize handle or widget controls
|
||||
if (e.target.closest('.resize-handle') || e.target.closest('.widget-edit-controls')) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
this.startDrag(e, element, widget, onDragEnd);
|
||||
};
|
||||
|
||||
const touchStartHandler = (e) => {
|
||||
// Don't drag if touching resize handle or widget controls
|
||||
if (e.target.closest('.resize-handle') || e.target.closest('.widget-edit-controls')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Delay touch drag to allow scrolling
|
||||
this.touchTimer = setTimeout(() => {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user