Skip to content

Commit 82a063b

Browse files
Fix: V16 Variant breadcrumb wrong after creating a nested document (#19492)
fixes the breadcrumb after created a new nested document
1 parent 3ca09e7 commit 82a063b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-breadcrumb/workspace-variant-menu-breadcrumb/workspace-variant-menu-breadcrumb.element.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ export class UmbWorkspaceVariantMenuBreadcrumbElement extends UmbLitElement {
5858

5959
#observeStructure() {
6060
if (!this.#structureContext || !this.#workspaceContext) return;
61-
const isNew = this.#workspaceContext.getIsNew();
6261

6362
this.observe(this.#structureContext.structure, (value) => {
64-
this._structure = isNew ? value : value.slice(0, -1);
63+
if (!this.#workspaceContext) return;
64+
const unique = this.#workspaceContext.getUnique();
65+
// exclude the current unique from the structure. We append this with an observer of the name
66+
this._structure = value.filter((structureItem) => structureItem.unique !== unique);
6567
});
6668
}
6769

0 commit comments

Comments
 (0)