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 a bug where Bold can be expanded in tree

Roman Pominovd306f2ec71df
diff --git a/apps/designer/app/designer/shared/tree/index.tsx b/apps/designer/app/designer/shared/tree/index.tsx
index f47c5e3247..e2a447362f 100644
--- a/apps/designer/app/designer/shared/tree/index.tsx
+++ b/apps/designer/app/designer/shared/tree/index.tsx
@@ -23,9 +23,14 @@ const instanceRelatedProps = {
return components[item.component].canAcceptChildren;
},
getItemChildren(item: Instance) {
- // Only content editable components can have `string` children
- // and this cab be a hot path for performance.
- if (components[item.component].isContentEditable === false) {
+ const component = components[item.component];
+
+ // We want to avoid calling .filter() unnecessarily, because this is a hot path for performance.
+ // We rely on the fact that only content editable or inline components may have `string` children.
+ if (
+ component.isContentEditable === false &&
+ component.isInlineOnly === false
+ ) {
return item.children as Instance[];
}