Skip to content
Snippets Groups Projects
Commit 485ccd50 authored by Julian's avatar Julian
Browse files

Remove grid ids from non-emitted items

parent 377f131e
No related branches found
No related tags found
1 merge request!2Resolve "Implement basic functionality"
Pipeline #112818 failed
...@@ -199,6 +199,9 @@ export default { ...@@ -199,6 +199,9 @@ export default {
if (!newPositionValid) return; if (!newPositionValid) return;
element.x = coords.x;
element.y = coords.y;
try { try {
let valueCopy = structuredClone(this.value); let valueCopy = structuredClone(this.value);
...@@ -207,7 +210,12 @@ export default { ...@@ -207,7 +210,12 @@ export default {
}); });
if (index >= 0) valueCopy.splice(index, 1); if (index >= 0) valueCopy.splice(index, 1);
valueCopy.push(element); let elementCopy = structuredClone(element);
elementCopy.context = undefined;
elementCopy.originGridId = undefined;
valueCopy.push(elementCopy);
this.$emit("input", valueCopy); this.$emit("input", valueCopy);
} catch (e) { } catch (e) {
if (e.code === DOMException.DATA_CLONE_ERR) { if (e.code === DOMException.DATA_CLONE_ERR) {
...@@ -220,9 +228,8 @@ export default { ...@@ -220,9 +228,8 @@ export default {
} }
} }
element.x = coords.x;
element.y = coords.y;
element.gridId = this.gridId; element.gridId = this.gridId;
this.$emit("itemChanged", element); this.$emit("itemChanged", element);
}, },
getCoords(x, y) { getCoords(x, y) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment