I am using PrimNG 9 with Angular 8, I implemented p-splitButton in the body of p-table, when I click on Edit or Delete the click sometimes works and sometimes doesn't work. Anyone can help please! (See the screen below)
Html:
<p-splitButton label="Show details" styleClass="split-button"
(onClick)="showDetails(project)" appendTo="body" [model]="itemsSplitButton(project)">
</p-splitButton>
Ts:
itemsSplitButton: any;
ngOnInit() {
this.initItemsSplitButton();
}
initItemsSplitButton() {
this.itemsSplitButton = (project) => {
return [
{
label: 'Edit', icon: 'pi pi-pencil', command: () => {
console.log('Edit was clicked);},
{
label: 'Delete', icon: 'pi pi-trash', command: () => {
console.log('Delete was clicked);};}]}

Try with this code