Search and Top Navigation
#5559 closed bug (fixed)
Opened April 28, 2010 09:17AM UTC
Closed December 03, 2012 03:37PM UTC
Last modified December 19, 2012 02:16AM UTC
Dialog: Content grows bigger than widget on resize at document edge
Reported by: | sjonne | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.10.0 |
Component: | ui.dialog | Version: | 1.8 |
Keywords: | Dialog content resize overgrowth | Cc: | |
Blocked by: | Blocking: |
Description
Problem:
When resizing the dialog beyond to right or bottom edge of the document, the dialog stops growing (as expected), but the content "div" does not.
Screenshot from Firebug in FF, with the content div selected:
[[Image(http://img704.imageshack.us/img704/9463/dialoguierror.png)]]
How to create the problem:
1. Open http://jqueryui.com/demos/dialog/#default
2. Drag the dialog to the left edge of the screen.
3. Grab the resize handle and drag it to the right edge of your screen.
4. Repeat step 3. 5-10 times, and the text begins to disappear to the right.
Other browsers:
I got the same behavior in chrome. In IE7 it works fine when the browser was not maximized.
Attachments (0)
Change History (14)
Changed May 08, 2010 06:32AM UTC by comment:1
Changed May 10, 2010 12:17PM UTC by comment:2
I think In IE it seems to work fine because IE raises the mouse move event only when the mouse cursor is in the browser.
Test Code:
$(document).mousemove(function () { document.title = parseInt(document.title)+1 || 0; });
The problem may be in ui.resizable.
See:
jQuery UI 1.8.1 uncompressed version.
jquery.ui.dialog.js
line 410(dialog _makeResizable)
self.uiDialog.resizable({ cancel: '.ui-dialog-content', containment: 'document', alsoResize: self.element, ...
"self.element" means the dialog content.
"self.uiDialog" means the wrapper of the content.
jquery.ui.resizable.js
line 300(resizable _mouseDrag)
this._propagate("resize", event);
line 501(resizable _propagate)
$.ui.plugin.call(this, n, [event, this.ui()]);
There are some plugins having "resize" member.
1. line 552(resizable alsoResize resize)
2. line 676(resizable containment resize)
3. line 748(resizable ghost resize)
4. line 760(resizable grid resize)
line 576(resizable alsoResize resize _alsoResize)
el.css(style);
plugin "alsoResize" resizes el(=the dialog content).
line 706(resizable containment resize)
if (woset + self.size.width >= self.parentData.width) {
plugin "containment" respects the size of the "containment" element(=document).
line 302(resizable _mouseDrag)
el.css({ top: this.position.top + "px", left: this.position.left + "px", width: this.size.width + "px", height: this.size.height + "px" });
"el" means the wrapper of the dialog content.
Problem:
The size of the "alsoResize" element(=dialog content) does not respect the size of "containment" element(=document).
Workaround:
I don't know.
"Adding plugin 'containment' first" may work.
Changed March 11, 2012 07:00AM UTC by comment:6
_comment0: | If you don't want edit source there is workaround for 1.8.7 \ \ {{{ \ var temp; \ temp = plg['start'][0]; \ plg['start'][0] = plg['start'][1]; \ plg['start'][1] = temp; \ \ temp = plg['resize'][0]; \ plg['resize'][0] = plg['resize'][1]; \ plg['resize'][1] = temp; \ \ temp = plg['stop'][0]; \ plg['stop'][0] = plg['stop'][2]; \ plg['stop'][2] = temp; \ }}} \ → 1331449332720697 |
---|
If you don't want edit source there is workaround for 1.8.7
var plg = $.ui['resizable'].prototype.plugins; // 0 - AlsoResize, 1 - Containment var temp; temp = plg['start'][0]; plg['start'][0] = plg['start'][1]; plg['start'][1] = temp; temp = plg['resize'][0]; plg['resize'][0] = plg['resize'][1]; plg['resize'][1] = temp; // 0 - AlsoResize, 2 - Containment temp = plg['stop'][0]; plg['stop'][0] = plg['stop'][2]; plg['stop'][2] = temp;
Changed August 17, 2012 01:23AM UTC by comment:8
_comment0: | The current behavior of this bug on the demo page (http://jqueryui.com/demos/dialog/#default) is that the content (.ui-dialog-content) grows by 1px in comparison to the entire dialog (.ui-dialog) per every resize of that axis. 3 separate horizontal resize operations means the content is now 3px larger than it should be. \ \ I have also observed that the content may shrink on resize (by a much greater factor of 1px). I have seen a dialog box's content shrink by 12px (corresponds to 1em on the stylesheet) per every resizestart event. Unfortunately, I haven't had the time to provide a reduced test case to figure out what causes the discrepancy in offset and magnitude. \ \ Possibly an erroneous relative margin / padding calculation? → 1345166651426119 |
---|
The current behavior of this bug on the demo page (http://jqueryui.com/demos/dialog/#default) is that the content (.ui-dialog-content) grows by 1px in comparison to the entire dialog (.ui-dialog) per every resize of that axis. 3 separate horizontal resize operations means the content is now 3px wider than it should be.
I have also observed that the content may shrink on resize (by a much greater factor of 1px). I have seen a dialog box's content shrink by 12px (corresponds to 1em on the stylesheet) per every resizestart event. Unfortunately, I haven't had the time to provide a reduced test case to figure out what causes the discrepancy in offset and magnitude.
Possibly an erroneous relative margin / padding calculation?
Changed August 17, 2012 10:17PM UTC by comment:9
I just submitted ticket #8506 and a pull request for it as well. The issues might be related.
Changed October 11, 2012 09:02PM UTC by comment:10
milestone: | TBD → 1.10.0 |
---|
Changed October 15, 2012 06:41PM UTC by comment:11
status: | new → open |
---|---|
summary: | Dialog content grows bigger then widget on resize at document edge → Dialog: Content grows bigger then widget on resize at document edge |
Changed December 03, 2012 03:19PM UTC by comment:12
summary: | Dialog: Content grows bigger then widget on resize at document edge → Dialog: Content grows bigger than widget on resize at document edge |
---|
Changed December 03, 2012 03:37PM UTC by comment:13
resolution: | → fixed |
---|---|
status: | open → closed |
Changed December 19, 2012 02:16AM UTC by comment:14
#8921 is a duplicate of this ticket.
How to create the problem:
1. Open http://jqueryui.com/demos/dialog/#default
2. Drag the window to the left edge of your screen.
3. Drag the dialog to the right edge of the document.
4. Grab the resize handle of the dialog.
5. Drag it to the right edge of your screen.
6. Release the mouse button at the right edge of your screen.
Other browsers:
I got the same behavior in
it works fine in