Skip to content

Commit

Permalink
fix: removed relative-column class from rectangle
Browse files Browse the repository at this point in the history
from rectangle removed relative-column as there isn't any flex related css for column
adding that class caused border to be removed when it was applied from rectangle class.

also, added filter to remove classes getting added multiple times.
  • Loading branch information
maharshivpatel committed Jun 25, 2024
1 parent c236179 commit 4895551
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export const useElementStore = defineStore("ElementStore", {
if (el.type == "rectangle") {
el.childrens = this.computeRowLayout(el.childrens, el);
el.layoutType = "column";
el.classes.push("relative-column");
el.classes = el.classes.filter((c) => c != "relative-column");
el.rectangleContainer = true;
if (el.childrens.some((e) => e.heightType == "auto-min-height")) {
el.heightType = "auto-min-height";
Expand Down Expand Up @@ -780,13 +780,15 @@ export const useElementStore = defineStore("ElementStore", {
if (wrapper.layoutType == "column") {
wrapper.width = dimensions.right - dimensions.left;
wrapper.height = parent.height || 0;
wrapper.classes = wrapper.classes.filter((c) => c != "relative-column");
wrapper.classes.push("relative-column");
wrapper.relativeColumn = true;
} else {
wrapper.width =
parent.width ||
MainStore.page.width - MainStore.page.marginLeft - MainStore.page.marginRight;
wrapper.height = dimensions.bottom - dimensions.top;
wrapper.classes = wrapper.classes.filter((c) => c != "relative-row");
wrapper.classes.push("relative-row");
wrapper.classes.push(wrapper.id);
}
Expand Down Expand Up @@ -880,6 +882,7 @@ export const useElementStore = defineStore("ElementStore", {
parent.width ||
MainStore.page.width - MainStore.page.marginLeft - MainStore.page.marginRight;
wrapper.height = dimension.bottom - dimension.top;
wrapper.classes = wrapper.classes.filter((c) => c != "relative-row");
wrapper.classes.push("relative-row");
delete wrapper.parent;
this.updateRowElement(wrapper, currentRow, parent);
Expand Down Expand Up @@ -927,6 +930,7 @@ export const useElementStore = defineStore("ElementStore", {
wrapper.layoutType = "column";
wrapper.width = dimension.right - dimension.left;
wrapper.height = parent.height;
wrapper.classes = wrapper.classes.filter((c) => c != "relative-column");
wrapper.classes.push("relative-column");
wrapper.relativeColumn = true;
delete wrapper.parent;
Expand Down

0 comments on commit 4895551

Please sign in to comment.