primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
9.53k stars 4.47k forks source link

DialogService dont open same component multiple times #15384

Open macedo8 opened 2 weeks ago

macedo8 commented 2 weeks ago

Describe the bug

I'm developing a component that, after opening a dialog, I can minimize and place only the header of the window on the footer of the page. When I try to open a new window from the same previous component, the dialogService open method returns a null ref.

Is there any way it can return the new object?

Environment

public show(componentType: Type<any>, configs: DynamicDialogConfig): DynamicDialogRef {
 configs.templates = {
   header: DialogHeaderComponent
 };

 const ref = this.dialogService.open(componentType, configs);  <-- Error: ref is null

 const instance = this.dialogService.getInstance(ref);

 this._controller.addDialog({
   ref: ref,
   instance: instance,
   componentRef: this.dialogService.dialogComponentRefMap.get(ref)!,
   minimize: false
 });

return ref;

}

Reproducer

No response

Angular version

17.3.1

PrimeNG version

17.12.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.19.1

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response