mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
fix: dont update state when appDef is equal to newDef (#2576)
This commit is contained in:
parent
81bed483f9
commit
8a6df632d2
2 changed files with 5 additions and 3 deletions
|
|
@ -178,7 +178,7 @@ export const Container = ({
|
|||
[left, top] = doSnapToGrid(canvasWidth, left, top);
|
||||
}
|
||||
|
||||
left = (left * 100) / canvasWidth;
|
||||
left = Math.round((left * 100) / canvasWidth);
|
||||
|
||||
if (item.currentLayout === 'mobile') {
|
||||
componentData.definition.others.showOnDesktop.value = false;
|
||||
|
|
@ -217,7 +217,7 @@ export const Container = ({
|
|||
|
||||
// Computing the left offset
|
||||
const leftOffset = nodeBounds.x - canvasBounds.x;
|
||||
const left = convertXToPercentage(leftOffset, canvasWidth);
|
||||
const left = Math.round(convertXToPercentage(leftOffset, canvasWidth));
|
||||
|
||||
// Computing the top offset
|
||||
const top = nodeBounds.y - canvasBounds.y;
|
||||
|
|
@ -262,7 +262,7 @@ export const Container = ({
|
|||
height = height + deltaHeight;
|
||||
|
||||
top = y;
|
||||
left = (x * 100) / canvasWidth;
|
||||
left = Math.round((x * 100) / canvasWidth);
|
||||
|
||||
let newBoxes = {
|
||||
...boxes,
|
||||
|
|
|
|||
|
|
@ -427,6 +427,8 @@ class Editor extends React.Component {
|
|||
};
|
||||
|
||||
appDefinitionChanged = (newDefinition, opts = {}) => {
|
||||
if (isEqual(this.state.appDefinition, newDefinition)) return;
|
||||
|
||||
produce(
|
||||
this.state.appDefinition,
|
||||
(draft) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue