Skip to content

Commit

Permalink
fix(primeng/p-messages): close event emit not valid message
Browse files Browse the repository at this point in the history
  • Loading branch information
volvachev committed Apr 19, 2024
1 parent f41fa9c commit a0bd447
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/components/messages/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ export class Messages implements AfterContentInit, OnDestroy {
}

removeMessage(i: number) {
const removedMessage = this.messages[i];
this.messages = this.messages?.filter((msg, index) => index !== i);
this.messages[i] && this.onClose.emit(this.messages[i]);
removedMessage && this.onClose.emit(removedMessage);
this.valueChange.emit(this.messages);
}

Expand Down

0 comments on commit a0bd447

Please sign in to comment.