mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
fix: show resize handlers on hover
This commit is contained in:
parent
8cf0c49cd1
commit
9c094f023b
2 changed files with 23 additions and 23 deletions
|
|
@ -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({});
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue