mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-21 16:08:35 +00:00
Copy desktop width with threshold when enabling mobile layout
This commit is contained in:
parent
5664f2ef95
commit
bd2aa59f2a
1 changed files with 9 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue