fix: show resize handlers on hover

This commit is contained in:
Johnson Cherian 2024-01-10 10:41:07 +05:30
parent 8cf0c49cd1
commit 9c094f023b
2 changed files with 23 additions and 23 deletions

View file

@ -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({});

View file

@ -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,