BoldDesk®Customer service software with ticketing, live chat & omnichannel support, starting at $99/mo for unlimited agents. Try for free!
I have a menu that displays correctly the first time it is opened but displays duplicate menu items when it is opened after the first time (screenshot below). I have created a Stackblitz that recreates my use case and shows the bug. In the Stackblitz you will notice that the first time the menu opens, everything displays correctly. Howver, if you open the menu again, you'll see two of the menu items are duplicated. The Stackblitz can be found here: https://stackblitz.com/edit/angular-kd2jhcxz-yfemdvcn?file=src%2Fapp.component.ts
This looks like a bug to me.
... @Component({ imports: [MenuModule, ButtonModule], standalone: true, selector: 'app-root', template: `<div class="e-section-control"> <div class="control-section"> <div class="menu-section"> <ejs-menu #menu [items]='menuItems' (beforeOpen)='beforeOpen($event)' (created)='created()' (beforeClose)="beforeClose($event)"></ejs-menu> </div> </div> </div>`, }) export class AppComponent { @ViewChild('menu') public menuObj?: MenuComponent; ... public beforeClose(args: any) { this.menuObj?.removeItems(['dynamic-1', 'dynamic-2'], true); } } ... |
Regards,
Prasanth Madhaiyan.
Hello Prasanth,
I have confirmed that removing the dynamic menu items in the beforeClose event handler resolves the issue. Thank you for the solution.
Anthony.
Hi Anthony,
We're glad your issue was resolved. Please get back to us for further assistance in the future.
Regards,
Florence L.