primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Cancellable close event on Dialog

Open dcanning opened this issue 7 years ago • 2 comments

If you have a PrimeNG PRO Support subscription please post your issue at;

https://pro.primefaces.org

where our team will respond within 4 business hours.

If you do not have a PrimeNG PRO Support subscription, fill-in the report below. Please note that your issue will be added to the waiting list of community issues and will be reviewed on a first-come first-serve basis, as a result, the support team is unable to guarantee a specific schedule on when it will be reviewed. Thank you for your understanding.

Current Queue Time for Review Without PRO Support: ~8-12 weeks. With PRO Support: 1 hour

I'm submitting a ... (check one with "x")

[ X] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap

What is the motivation / use case for changing the behavior?

When the close button for DynamicDialog is clicked, proved an event that can be cancelled to prevent the dialog from closing. For example, the dialog contains a form, and if user changes some fields and click close button without saving. Under this situation, I want to prevent user from closing the dialog and ask user whether to save data or not

  • Angular version: 8.X
  • PrimeNG version: 8.X

dcanning avatar Dec 04 '19 15:12 dcanning

I would also love to have this feature and would go one step further:

I would be delighted if I could provide either a function that determines whether or not the dialog should be closed or a canDeactivate-Guard to the dialogService when opening the dialog. This way the component could be as independent from the closability-logic as we are used to from Guards protecting us from leaving routes :)

jSebestyen590 avatar Jan 18 '21 17:01 jSebestyen590

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 reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

mertsincan avatar Nov 09 '22 19:11 mertsincan