Skip to content

Commit

Permalink
fix ( dot-action-menu-button): #29826 Actions in listing not working …
Browse files Browse the repository at this point in the history
…properly (#29827)

### Proposed Changes
* Defined the correct event type to avoid error in the actions. 


### Screenshots

Before: 


![Image](https://github.com/user-attachments/assets/35b29a09-6fb6-4e99-994e-1115b7cd0214)

After: 

<img width="1012" alt="image"
src="https://github.com/user-attachments/assets/5205dd84-759a-458f-90ce-752830b3794e">
  • Loading branch information
hmoreras authored Sep 2, 2024
1 parent f21795e commit f234736
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { Component, Input, OnInit } from '@angular/core';

import { MenuItem } from 'primeng/api';
import { ButtonModule } from 'primeng/button';
import { TooltipModule } from 'primeng/tooltip';

import { CustomMenuItem, DotActionMenuItem } from '@dotcms/dotcms-models';

import { DotMenuComponent } from '../dot-menu/dot-menu.component';

interface DotActionMenuClickEvent {
item: MenuItem;
originalEvent: MouseEvent;
}

/**
* The DotActionMenuButtonComponent is a configurable button with
* menu component as a pop up
Expand Down Expand Up @@ -37,10 +43,10 @@ export class DotActionMenuButtonComponent implements OnInit {
.map((action: DotActionMenuItem) => {
return {
...action.menuItem,
command: ($event: MouseEvent) => {
command: ($event: DotActionMenuClickEvent) => {
action.menuItem.command(this.item);

$event.stopPropagation();
$event.originalEvent.stopPropagation();
}
};
});
Expand Down

0 comments on commit f234736

Please sign in to comment.