Closed gustavobmichel closed 6 years ago
That's a good idea for a new feature.
Here's a potential workaround in the mean time:
<tr *ngFor="let item of itemList" (contextmenu)="onContextMenu($event, item)" [class.active]="item === activeItem">
activeItem: any;
onContextMenu(event: MouseEvent, item: any) {
this.activeItem = item;
this.contextMenuService.next.emit({
// etc...
});
}
Thanks for the quick response.
I implemented it as per your suggestion. The only thing I added was <context-menu (close)="onCloseContextMenu()"> so that it clears the selection once you close the context menu.
When you have multiple lines it's difficult to know which line has triggered the context menu. It'd be very useful to have a class on the parent element.
For example: If I have got a table and I have applied the context menu to the tr, when you activate the context menu, the tr could have a css class to show it's currently active.