Skip to content

Commit

Permalink
Fixed #16219 - Menu: console.error when selecting a menu item with ke…
Browse files Browse the repository at this point in the history
…yboard
  • Loading branch information
mehmetcetin01140 committed Nov 11, 2024
1 parent 97ad926 commit 12fd141
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/primeng/src/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ export class Menu extends BaseComponent implements OnDestroy {
const documentTarget: any = this.el ? this.el.nativeElement.ownerDocument : 'document';

this.documentClickListener = this.renderer.listen(documentTarget, 'click', (event) => {
const isOutsideContainer = this.containerViewChild.nativeElement && !this.containerViewChild.nativeElement.contains(event.target);
const isOutsideContainer = this.containerViewChild?.nativeElement && !this.containerViewChild?.nativeElement.contains(event.target);
const isOutsideTarget = !(this.target && (this.target === event.target || this.target.contains(event.target)));
if (!this.popup && isOutsideContainer && isOutsideTarget) {
this.onListBlur(event);
Expand Down

0 comments on commit 12fd141

Please sign in to comment.