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

Dialog: visibleChange does not emit when dialog opens #14688

Closed
LoaderB0T opened this issue Feb 1, 2024 · 2 comments
Closed

Dialog: visibleChange does not emit when dialog opens #14688

LoaderB0T opened this issue Feb 1, 2024 · 2 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@LoaderB0T
Copy link
Contributor

LoaderB0T commented Feb 1, 2024

Describe the bug

When using a dialog element, the visibleChange output only emits false when the dialog is hidden (visible set to false).

It would be great to also emit true when the dialog is opened (visible set to true).

This would be great for directives that build upon opening/closing dialogs as the input value of visible is not easily usable from there.

Exemplary Code:

<p-dialog [visible]="someValue$ | async" (visibleChange)="someMethod($event)>
//...
</p-dialog>
protected someMethod(event: boolean) {
  console.log(event);
}

Expected Behavior:
Console logs show "true" when opening and "false" when closing the dialog

Actual behavior:
Console logs only show false when closing, and nothing when opening the dialog

We will gladly try to contribute a PR for a solution if you agree that this should be the behavior.

Angular version

17.0.X

PrimeNG version

17.3.3

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.9

Browser(s)

Chrome 120

@LoaderB0T LoaderB0T added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 1, 2024
@LoaderB0T
Copy link
Contributor Author

LoaderB0T commented Feb 1, 2024

Just had an afterthought. If this is not preferred because of two way databinding, I would like to add another EventEmitter like "visibilityChanged" or something to not introduce problems for two way databinding.

Edit: we cannot use onshow because it is only triggered after the dialog opening animation which is too late for our use case

@mehmetcetin01140
Copy link
Contributor

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you open a new issue so we can include it in our roadmap?

Thanks a lot for your understanding!
Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants