I am working on a little project to convert the Angular Diagram Builder showcase project to version 7 from version 5 of Angular.
The project is now mostly working except for the menu. Initially, it didn't open at all. After some debugging, I traced it to arrangeMenuBeforeOpen in home.component.ts
public arrangeMenuBeforeOpen(args: BeforeOpenCloseArgs): void {
(args.element.children[0] as HTMLElement).style.display = 'block'
if (args.event && closest(args.event.target as Element, '.e-dropdown-btn') != null {
args.cancel = true;
}
}
it was hitting the args.cancel = true line. In angular 5 args.event is null, but in Angular 7 it is a mouse event. After commenting out this line the menu is opening properly, but now the dropdown stays open. See attached.
Attachment:
MenuIssue.PNG_d254124c.zip