Skip to content

Commit

Permalink
Merge pull request #43872 from phillip-kruger/dev-ui-custom-side-menu…
Browse files Browse the repository at this point in the history
…-fix

Dev UI: Small cosmetic fix for dynamic menus
  • Loading branch information
phillip-kruger authored Oct 15, 2024
2 parents 7773228 + acf4f18 commit 143bd48
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class QwcMenu extends observeState(LitElement) {

let items = [{ text: 'Remove', action: 'remove', id: page.id , namespace: page.namespace}];
return html`<vaadin-context-menu .items=${items} @item-selected=${this._handleContextMenu} title="${extensionName}">
${this._renderItem(page, index)}
${this._renderItem(page, -1)}
</vaadin-context-menu>`;
}
}
Expand Down Expand Up @@ -295,7 +295,11 @@ export class QwcMenu extends observeState(LitElement) {
hasMenuItem = true;
}
}

if(!hasMenuItem){
// Check the dynamic pages
hasMenuItem = this._dynamicMenuNamespaces.some(item => item.namespace === this._selectedPage);
}

if(!hasMenuItem && index === 0){
return "item selected";
}
Expand Down

0 comments on commit 143bd48

Please sign in to comment.