Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p-confirmPopup: Does not show even with a valid target #11831

Closed
psarno opened this issue Aug 16, 2022 · 3 comments · Fixed by #11870
Closed

p-confirmPopup: Does not show even with a valid target #11831

psarno opened this issue Aug 16, 2022 · 3 comments · Fixed by #11870
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@psarno
Copy link

psarno commented Aug 16, 2022

Describe the bug

My code looks like this:

    console.log(this.contextEvent.target);

    this.confirmationService.confirm({
      target: this.contextEvent.target ? this.contextEvent.target : undefined,
      message: 'Are you sure that you want to proceed?',
      icon: 'pi pi-exclamation-triangle',
      accept: () => { console.log('accepted')  }
    });

The console.log is properly showing a valid target that I want the confirmation pop-up to appear on. However, it never shows up and no errors are shown in the console.

Environment

Angular 14.0.3
PrimeNG 14.0.0

Reproducer

https://stackblitz.com/edit/github-gz4bm8?file=src/app/app.component.ts

Angular version

14.0.3

PrimeNG version

14.0.0

Build / Runtime

TypeScript

Language

TypeScript

Node version (for AoT issues node --version)

16.13.1

Browser(s)

No response

Steps to reproduce the behavior

The repro in Stackblitz shows the behavior.

  1. Click on the ellipse button to show a context menu
  2. Select "Email" on that menu
  3. A confirmation dialog should appear, but it does not.

Expected behavior

A confirmation dialog should appear at the location of the valid event target.

@psarno psarno added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Aug 16, 2022
@volvachev
Copy link
Contributor

Hi, could you please update the link(stackblitz)?

@psarno
Copy link
Author

psarno commented Aug 24, 2022

@volvachev The following should show the example.

In this case, I want the confirm popup to target the button after the context menu item has been clicked. If I am approaching this wrong, let me know, but the console does show a valid event target.

https://stackblitz.com/edit/github-gz4bm8?file=src/app/app.component.ts

@volvachev
Copy link
Contributor

@volvachev The following should show the example.

In this case, I want the confirm popup to target the button after the context menu item has been clicked. If I am approaching this wrong, let me know, but the console does show a valid event target.

https://stackblitz.com/edit/github-gz4bm8?file=src/app/app.component.ts

Hi, I have updated the example (https://stackblitz.com/edit/github-gz4bm8-mrihjk). But you need to use setTimeout there to make it work. I also opened a fix in the library.

@cetincakiroglu cetincakiroglu added this to the 14.0.3 milestone Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants