JQuery-ui dialog jumps to the bottom of page in Chrome
Asked Answered
T

9

12

I`m using jquery ui (jquery-ui-1.10.3) and faced some problem with dialog in Chrome.

I`m opening dialog in the following way:

$('#dialog').dialog({
    width: 400,
    buttons: {
        "save": function() { update(); $( this ).dialog( "close" ); }
    }
});

This dialog is draggable. Dialog appears perfectly, but as soon as I need to drag it, dialog goes/jumps to the bottom of a page, even under the scroll. And this happens only in Chrome.

Maybe somebody faced the same problem. Any ideas?

Thanks

Tame answered 20/6, 2013 at 11:38 Comment(3)
Did you find a solution to this issue? I have just upgraded from Dialog 1.8.16 to Dialog 1.10.3 and am experiencing the same issue in Firefox -but not in Chrome.Communalism
No, did not find solution yet ( Which version of Firefox and Chrome do you use? I use chrome Version 27.0.1453.116 m and Firefox and Firefox 22.0Tame
Apologize - have been away for some time. I'm on FF22 and Chrome 23.0.1271.95 (Linux Ubuntu).Communalism
S
7

It's a bug in jQuery UI 1.10.3 - http://bugs.jqueryui.com/ticket/9315. Also could be marked as dupe of jQuery ui dialog dragging issues.

Simmers answered 2/7, 2013 at 14:37 Comment(6)
Just read the issue - believe this is exactly what struck in my case.Communalism
Make sure you've not overridden CSS of Jquery UI dialog with top/bottom/left/right and position:absolute.Kurr
This was my issue in Firefox and Chrome as well. They released 1.10.4 recently and that seems to fix the issue.Letterperfect
This issue was not fixed with the 1.10.4 release. Go to the demos page in IE8 and attempt to drag the dialog to see the bug.Tala
I am using jqueryui 1.11.0 and have the same issue. I will give the current jquery 1.11.1 a try later on. God to know it is a bug I will not dive deeper into it.Boondocks
still there wit 1.11.1 --- very unfortunateBoondocks
A
3

This seems to fix it

html, body {position: relative}
Alroy answered 14/5, 2014 at 6:0 Comment(0)
S
1

I had set the parent element's (in my case the body tag) position to static (it was relative) and it fixed the problem.

if (isChrome){ document.getElementsByTagName("body")[0].style.position = 'static'; }

Off course "isChrome" variable needs to be calculated before.

Also you have to check if this change doesn't ruins your existing layout.

Hope it helps
Andras

Scrivens answered 10/9, 2015 at 8:9 Comment(0)
C
1

Tried

html, body {position: relative}

but it didn't work for me.. However, found this worked for my situation.

body { height: 100%; }

Fixes quite a few strange issues.

Crackerbarrel answered 15/3, 2021 at 20:23 Comment(0)
D
0

For me jquery-ui 1.10.1 worked well. The said bug in 1.10.3 seems to be in 1.10.4 too.

Dulaney answered 30/9, 2014 at 14:43 Comment(0)
L
0

It doesn't work in jQuery UI 1.10.3 even if the bug says that it's fixed. I found it fixed in: jQuery UI 1.11.2, haven't tried any version below. But all good with 1.11.2

Lajuanalake answered 5/2, 2015 at 11:18 Comment(0)
A
0

try

$( "#dialog-confirm" ).dialog({position: 'center',...

solved my problem using jquery-ui-1.9.2.custom

Angloirish answered 20/5, 2015 at 10:2 Comment(0)
J
0

Adding the stylesheet:

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">

fixed it for me

All versions and docs

Joell answered 8/10, 2018 at 17:12 Comment(0)
I
0

Add relative positioning to necessary element(s):

html, body, header, nav, main, footer, article, section, summary{ position: relative; },

I added relative positioning to my body element and that solved my issue. I'm using jquery-ui-1.10.4

Intuition answered 19/2, 2019 at 7:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.