mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-08 17:50:56 +00:00
Fixed bug that caused incorrect layout being repositioned
This commit is contained in:
parent
4700063eef
commit
baeeca9702
2 changed files with 7 additions and 7 deletions
|
|
@ -93,7 +93,7 @@ export const Container = ({
|
|||
}
|
||||
|
||||
let layouts = item['layouts'];
|
||||
const currentLayoutOptions = layouts ? layouts[currentLayout] : {};
|
||||
const currentLayoutOptions = layouts ? layouts[item.currentLayout] : {};
|
||||
|
||||
let componentData = {};
|
||||
let componentMeta = {};
|
||||
|
|
@ -129,8 +129,8 @@ export const Container = ({
|
|||
...boxes[id],
|
||||
layouts: {
|
||||
...boxes[id]['layouts'],
|
||||
[currentLayout]: {
|
||||
...boxes[id]['layouts'][currentLayout],
|
||||
[item.currentLayout]: {
|
||||
...boxes[id]['layouts'][item.currentLayout],
|
||||
top: top,
|
||||
left: left,
|
||||
}
|
||||
|
|
@ -165,7 +165,7 @@ export const Container = ({
|
|||
[id]: {
|
||||
component: componentData,
|
||||
layouts: {
|
||||
[currentLayout]: {
|
||||
[item.currentLayout]: {
|
||||
top: top,
|
||||
left: left,
|
||||
width: componentMeta.defaultSize.width,
|
||||
|
|
@ -291,7 +291,7 @@ export const Container = ({
|
|||
configHandleClicked,
|
||||
removeComponent,
|
||||
currentLayout,
|
||||
scaleValue
|
||||
scaleValue
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,13 +79,13 @@ export const DraggableBox = function DraggableBox({
|
|||
() => ({
|
||||
type: ItemTypes.BOX,
|
||||
item: {
|
||||
id, title, component, zoomLevel, parent, layouts
|
||||
id, title, component, zoomLevel, parent, layouts, currentLayout
|
||||
},
|
||||
collect: (monitor) => ({
|
||||
isDragging: monitor.isDragging()
|
||||
})
|
||||
}),
|
||||
[id, title, component, index, zoomLevel, parent, layouts]
|
||||
[id, title, component, index, zoomLevel, parent, layouts, currentLayout]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue