#17657 closed defect (wontfix)
dialog fails to appear and js error ie8 ie9 quirksmode when dialog height greater than viewport
Reported by: | Larry Chu | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Dijit | Version: | 1.9.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I am seeing in ie8 and ie9 quirksmode that the dialog fails to show and there is a js error when the dialog's height is greater than the viewport. dojo is calculating a negative height for the dialog contents containerNode.
In the following code sample, when the browser has a viewport height that is less than the dialog's height, a javascript error will appear.
<html > <head> <link rel="stylesheet" href="http://dojotoolkit.org/reference-guide/1.9/_static/js//dijit/themes/claro/claro.css"> <script>dojoConfig = {parseOnLoad: true}</script> <script src='http://dojotoolkit.org/reference-guide/1.9/_static/js/dojo/dojo.js.uncompressed.js'></script> <script> require(["dijit/Dialog", "dojo/domReady!"], function(Dialog){ myDialog = new Dialog({ title: "My Dialog", content: "Test content.", style: "height: 615px" }); }); </script> </head> <body class="claro"> <button onclick="myDialog.show();">show</button> </body> </html>
Attachments (2)
Change History (7)
Changed 7 years ago by
comment:1 Changed 7 years ago by
Component: | General → Dijit |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
You shouldn't be specifying a height to the Dialog like that. When necessary, Dialog will resize itself to fit within the viewport, and you are interfering with that functionality. If you want to set a preferred size you can set it on a <div> inside the Dialog, like
<div data-dojo-type=dijit/Dialog> <div style="height: 800px;"> ... </div> </div>
comment:2 Changed 7 years ago by
That sounds like an excuse to me. The dojo online reference guide has a example that applies a fixed width to the dialog. How can the reference guide have an example that recommends doing something that you shouldn't do?
http://dojotoolkit.org/reference-guide/1.9/dijit/Dialog.html
comment:3 Changed 7 years ago by
I think this item was closed prematurely. I have a case where the sizing of the dialog is left to the widget (no explicit height or width setting provided when dialog is instantiated), and when resizing the browser window, mainly reducing its size, I sometimes get a javascript error indicating invalid argument because dijit ends up calculating a negative height.
The resizing code should check for such conditions to avoid a runtime error from happening. Maybe when such a condition occurs, to skip that given resize operation.
I see get errors in Dojo 1.8.5. My quick look at Dojo 1.9.2 indicates that the same problem will happen since there is no sanity checks on dimensions computed.
Changed 7 years ago by
Attachment: | dojo-dialog-resize-bug-iedev.png added |
---|
IE developer window showing negative height calculation
comment:4 Changed 7 years ago by
@ehood - Sounds like a separate issue, but if you have a test case (or instructions to reproduce on an existing test case) I'd be happy to look at it. I want to figure out why you are getting that weird calculation of -500. So if you have a test case please open a new ticket and attach it.
html file exhibiting the broken dialog