diff --git a/frontend/src/Editor/Container.jsx b/frontend/src/Editor/Container.jsx index 0ff8911070..2e7f959fbe 100644 --- a/frontend/src/Editor/Container.jsx +++ b/frontend/src/Editor/Container.jsx @@ -106,26 +106,26 @@ export const Container = ({ const [canvasHeight, setCanvasHeight] = useState(null); useEffect(() => { - if (currentLayout === 'mobile' && appDefinition.pages[currentPageId]?.autoComputeLayout) { - const mobLayouts = Object.keys(boxes).map((key) => { - return { ...cloneDeep(boxes[key]?.layouts?.desktop), i: key }; - }); - const updatedBoxes = cloneDeep(boxes); - let newmMobLayouts = correctBounds(mobLayouts, { cols: 12 }); - newmMobLayouts = compact(newmMobLayouts, 'vertical', 12); - Object.keys(boxes).forEach((id) => { - const mobLayout = newmMobLayouts.find((layout) => layout.i === id); - updatedBoxes[id].layouts.mobile = { - left: mobLayout.left, - height: mobLayout.height, - top: mobLayout.top, - width: mobLayout.width, - }; - }); - setBoxes({ ...updatedBoxes }); - // console.log('currentLayout', data); - } - setNoOfGrids(currentLayout === 'mobile' ? 12 : 43); + // if (currentLayout === 'mobile' && appDefinition.pages[currentPageId]?.autoComputeLayout) { + // const mobLayouts = Object.keys(boxes).map((key) => { + // return { ...cloneDeep(boxes[key]?.layouts?.desktop), i: key }; + // }); + // const updatedBoxes = cloneDeep(boxes); + // let newmMobLayouts = correctBounds(mobLayouts, { cols: 12 }); + // newmMobLayouts = compact(newmMobLayouts, 'vertical', 12); + // Object.keys(boxes).forEach((id) => { + // const mobLayout = newmMobLayouts.find((layout) => layout.i === id); + // updatedBoxes[id].layouts.mobile = { + // left: mobLayout.left, + // height: mobLayout.height, + // top: mobLayout.top, + // width: mobLayout.width, + // }; + // }); + // setBoxes({ ...updatedBoxes }); + // // console.log('currentLayout', data); + // } + // setNoOfGrids(currentLayout === 'mobile' ? 12 : 43); }, [currentLayout]); const paramUpdatesOptsRef = useRef({}); diff --git a/frontend/src/Editor/DragContainer.jsx b/frontend/src/Editor/DragContainer.jsx index d60c85c6a8..da5033f8a1 100644 --- a/frontend/src/Editor/DragContainer.jsx +++ b/frontend/src/Editor/DragContainer.jsx @@ -312,8 +312,8 @@ export default function DragContainer({ ref={moveableRef} ables={[MouseCustomAble, DimensionViewable]} props={{ - mouseTest: false, - dimensionViewable: true, + mouseTest: true, + dimensionViewable: selectedComponents.length > 1, }} flushSync={flushSync} target={ @@ -683,7 +683,7 @@ export default function DragContainer({ flushSync={flushSync} key={i.parent} ref={(el) => (childMoveableRefs.current[i.parent] = el)} - ables={[DimensionViewable]} + ables={[MouseCustomAble, DimensionViewable]} props={{ mouseTest: true, dimensionViewable: selectedComponents.length > 2,