Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix dependency mapping for blockLevelElements

Oleg Isonend24766f30d34
diff --git a/apps/designer/app/designer/features/style-panel/shared/dependencies.ts b/apps/designer/app/designer/features/style-panel/shared/dependencies.ts
index de85a75c23..fee57c247a 100644
--- a/apps/designer/app/designer/features/style-panel/shared/dependencies.ts
+++ b/apps/designer/app/designer/features/style-panel/shared/dependencies.ts
@@ -75,7 +75,7 @@ export const dependencies: Dependencies = {
notValues: ["none"],
},
blockLevelElements: {
- property: "clear",
+ property: "display",
values: ["block", "flex", "grid", "table"],
},
allElementsExceptTableDisplayTypes: {
diff --git a/apps/designer/app/designer/features/style-panel/style-settings.tsx b/apps/designer/app/designer/features/style-panel/style-settings.tsx
index 64f9e247ca..4d2f35efe2 100644
--- a/apps/designer/app/designer/features/style-panel/style-settings.tsx
+++ b/apps/designer/app/designer/features/style-panel/style-settings.tsx
@@ -51,10 +51,12 @@ const appliesTo = (styleConfig: StyleConfig, currentStyle: Style): boolean => {
if (dependency === undefined) return false;
const currentValue = currentStyle[dependency.property]?.value;
if (currentValue === undefined) return false;
- if (Array.isArray(dependency.values))
+ if (Array.isArray(dependency.values)) {
return dependency.values.includes(String(currentValue));
- if (Array.isArray(dependency.notValues))
+ }
+ if (Array.isArray(dependency.notValues)) {
return dependency.notValues.includes(String(currentValue)) === false;
+ }
}
return true;