This is a migrated thread and some comments may be shown as answers.

Dialog does not respect minWidth attribute

3 Answers 48 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 08 Nov 2018, 08:13 PM

The Dialog component seems to ignore the minWidth, unless I am misunderstanding what the attribute does.  When I shrink the width of my screen the dialog does not resize to minWidth and my content goes off screen.  I have attached a GIF to demonstrate.  This behavior is also present on the examples from the documentation so it is not specific to my setup.

 

Here is my code, as you can see I have the minWidth set to 400px, but the content window does not start resizing until around 100px.  How can I force the dialog to resize appropriately so the content does not go off screen?

 

<kendo-dialog title="TERMS OF USE and PRIVACY POLICY" *ngIf="agreeOpen" (close)="closeAgree()" [minWidth]="400" [width]="500">
  <p class="text-left" [innerHtml]="termsConfig.content"></p>
  <kendo-dialog-actions>
    <button kendoButton (click)="closeAgree()" primary="true">Close</button>
  </kendo-dialog-actions>
</kendo-dialog>

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 09 Nov 2018, 08:44 AM
Hi James,


The Dialog component will not resize automatically in this case. The minWidth property is used in cases when the content of Dialog is dynamically sized. A possible solution to the current issue would be to attach a handler to the window.onresize event and update the Dialog width property accordingly. Here is an example that demonstrates this in action:

https://stackblitz.com/edit/angular-kh86he?file=app/app.component.ts

Regards,
Dimiter Madjarov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
James
Top achievements
Rank 1
answered on 09 Nov 2018, 11:25 PM
Thank you, ill try this out.  I think that might be a useful feature to have.  Maybe a true/false flag that determines if window should autosize or not when going out of bounds.
0
Dimiter Madjarov
Telerik team
answered on 12 Nov 2018, 09:31 AM
Hello James,


Thank you for the suggestion. This will be basically be the same as supporting setting the dimensions as a percentage (e.g. 100%). I would suggest to post the idea in our User Voice portal, so we could measure the demand for it:

http://kendoui-feedback.telerik.com/forums/555517-kendo-ui-for-angular-feedback

Regards,
Dimiter Madjarov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
James
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
James
Top achievements
Rank 1
Share this question
or