diff --git a/frontend/src/AppBuilder/AppCanvas/Grid/Grid.jsx b/frontend/src/AppBuilder/AppCanvas/Grid/Grid.jsx index baff04861c..deea310a10 100644 --- a/frontend/src/AppBuilder/AppCanvas/Grid/Grid.jsx +++ b/frontend/src/AppBuilder/AppCanvas/Grid/Grid.jsx @@ -592,7 +592,12 @@ export default function Grid({ gridWidth, currentLayout }) { onDragStart={(e) => { e?.moveable?.controlBox?.removeAttribute('data-off-screen'); const box = boxList.find((box) => box.id === e.target.id); - let isDragOnTableORCalendar = false; + + // This flag indicates whether the drag event originated on a child element within a component + // (e.g., inside a Table's columns, Calendar's dates, or Kanban's cards). + // When true, it prevents the parent component from being dragged, allowing the inner elements + // to handle their own interactions like column resizing or card dragging + let isDragOnInnerElement = false; /* If the drag or click is on a calender popup draggable interactions are not executed so that popups and other components inside calender popup works. Also user dont need to drag an calender from using popup */ @@ -603,20 +608,24 @@ export default function Grid({ gridWidth, currentLayout }) { /* Checking if the dragged elemenent is a table. If its a table drag is disabled since it will affect column resizing and reordering */ if (box?.component?.component === 'Table') { const tableElem = e.target.querySelector('.jet-data-table'); - isDragOnTableORCalendar = tableElem.contains(e.inputEvent.target); + isDragOnInnerElement = tableElem.contains(e.inputEvent.target); } if (box?.component?.component === 'Calendar') { const calenderElem = e.target.querySelector('.rbc-month-view') || e.target.querySelector('.rbc-time-view') || e.target.querySelector('.rbc-day-view'); - isDragOnTableORCalendar = calenderElem.contains(e.inputEvent.target); + isDragOnInnerElement = calenderElem.contains(e.inputEvent.target); } - if ( - ['RangeSlider', 'Container', 'BoundedBox', 'Kanban'].includes(box?.component?.component) || - isDragOnTableORCalendar - ) { + if (box?.component?.component === 'Kanban') { + const handleContainers = e.target.querySelectorAll('.handle-container'); + isDragOnInnerElement = Array.from(handleContainers).some((container) => + container.contains(e.inputEvent.target) + ); + } + + if (['RangeSlider', 'BoundedBox'].includes(box?.component?.component) || isDragOnInnerElement) { const targetElems = document.elementsFromPoint(e.clientX, e.clientY); const isHandle = targetElems.find((ele) => ele.classList.contains('handle-content')); if (!isHandle) { diff --git a/server/src/helpers/utils.helper.ts b/server/src/helpers/utils.helper.ts index 41dde11284..db24cae2f2 100644 --- a/server/src/helpers/utils.helper.ts +++ b/server/src/helpers/utils.helper.ts @@ -433,4 +433,4 @@ export const getSubpath = () => { } } return subpath; -}; \ No newline at end of file +};