From bd2aa59f2adaf89a81dc56ea1e6330edb0f8fb91 Mon Sep 17 00:00:00 2001 From: navaneeth Date: Thu, 3 Jun 2021 22:06:11 +0530 Subject: [PATCH] Copy desktop width with threshold when enabling mobile layout --- frontend/src/Editor/Inspector/Inspector.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/Editor/Inspector/Inspector.jsx b/frontend/src/Editor/Inspector/Inspector.jsx index deb78a2695..7f1f05c5d2 100644 --- a/frontend/src/Editor/Inspector/Inspector.jsx +++ b/frontend/src/Editor/Inspector/Inspector.jsx @@ -76,9 +76,17 @@ export const Inspector = ({ let newComponent = { ...component }; + + const { width, height } = newComponent.layouts['desktop']; + newComponent['layouts'] = { ...newComponent.layouts, - mobile: { top: 100, left: 0, width: 445, height: 500 } + mobile: { + top: 100, + left: 0, + width: Math.min(width, 445), + height: height + } } setComponent(newComponent);