diff --git a/apps/admin/src/features/brand/ComponentTemplatePreview.css b/apps/admin/src/features/brand/ComponentTemplatePreview.css index 3134f4c..880a1b7 100644 --- a/apps/admin/src/features/brand/ComponentTemplatePreview.css +++ b/apps/admin/src/features/brand/ComponentTemplatePreview.css @@ -128,9 +128,10 @@ .component-template-preview__outline span { position: absolute; - bottom: 100%; + top: 0; left: 0; - max-width: 100%; + max-width: calc(100% - 8px); + transform: translateY(-100%); padding: 2px 7px; overflow: hidden; border-radius: 4px 4px 0 0; @@ -142,6 +143,11 @@ white-space: nowrap; } +.component-template-preview__outline.is-selected span { + top: 4px; + transform: none; +} + .component-template-preview__tools[hidden] { display: none; } diff --git a/apps/admin/src/features/brand/ComponentTemplatePreview.tsx b/apps/admin/src/features/brand/ComponentTemplatePreview.tsx index 68af637..b53324e 100644 --- a/apps/admin/src/features/brand/ComponentTemplatePreview.tsx +++ b/apps/admin/src/features/brand/ComponentTemplatePreview.tsx @@ -89,7 +89,9 @@ export function ComponentTemplatePreview({ position(node, outlines.selected); host.append(node); } - for (const outline of outlines.composite) { + for (const outline of outlines.composite.filter( + (item) => item.key !== selection?.targetKey, + )) { const node = document.createElement("button"); node.type = "button"; node.className = "component-template-preview__composite-select";