Hi there,
The dialog width is changed after its first open,
from:<div class="igx-overlay__content--modal igx-overlay__content--relative" style="">
to:
<div class="igx-overlay__content--modal igx-overlay__content--relative" style="width: 1285.6px;>
But the content is only around 300px in width so the dialog is expanded beyond its content.What I've tried so far:
System:
For anyone else running into the same problem, I was able to fix it by surrounding the <igx-dialog> with a <div style="width: 0"> tag. This will keep the dialog from growing on subsequent rendering.
Hi Phan,
I have spent some more time on your sample trying to reproduce this issue with no success. Please if you are able to reproduce it in isolated sample send the sample to us so we can investigate it further.
As a workaround, I'll remove the style attribute from the outlet after opening the dialog
this.dialogOutletRef.nativeElement.querySelector('.igx-overlay__content--modal.igx-overlay__content--relative').removeAttribute("style");
Hello Milko,I've tried removing the condition but the problem still persists, even when I use a very simple dialog body.Will get back to you when more findings come up
I have inspected your new StackBlitz sample. What I saw is you are showing your popup-form after dialog isOpen becomes true. This may force the issue you are facing. At the moment we are show the dialog it has no any content, but a single title. The width of this dialog is about 280px. This is what we are trying to render. In the same time Angular detects that dialog is already shown and puts inside the popupFormComponent. If this happens fast enough we are showing the dialog with the correct size, otherwise we use the size of the initial dialog.
The question here is why you put the *ngIf in your popup form here:
<popup-form *ngIf="dialog.isOpen" (cancel)="closeDialog()" ></popup-form>
If you remove this *ngIf I think you should not face this issue.
Sincerely,MilkoSoftware Developer