Search and Top Navigation
#9315 closed bug (fixed)
Opened May 20, 2013 07:47AM UTC
Closed August 12, 2013 11:39PM UTC
Last modified November 17, 2017 01:41AM UTC
Draggable: jumps down with offset of scrollbar
Reported by: | j_geronimo | Owned by: | mikesherov |
---|---|---|---|
Priority: | blocker | Milestone: | 1.11.0 |
Component: | ui.draggable | Version: | 1.10.3 |
Keywords: | regression | Cc: | |
Blocked by: | Blocking: |
Description
That appears only with using UI 1.10.3 and when the scrollbar is not at the very top in Firefox, Opera, IE8.
In Chrome works fine and also with 1.10.2 on other browsers.
The UI dialog demo page has this bug too:
1. drag the dialog down until appears the scrollbar
2. scroll down
3. again drag the dialog down.
4. dialog goes down with the offset
Attachments (0)
Change History (66)
Changed May 22, 2013 12:29AM UTC by comment:1
status: | new → open |
---|
Changed May 22, 2013 01:44AM UTC by comment:2
This seems like the most likely ticket that caused the change in behavior http://bugs.jqueryui.com/ticket/6258, but I haven't confirmed that yet.
Changed May 22, 2013 02:58PM UTC by comment:4
Another test case from #9320: http://jsfiddle.net/tj_vantoll/7sU9L/. Works fine in Chrome/Safari and in all browsers in 1.10.2. Fails in Firefox/Opera on 1.10.3.
Changed May 22, 2013 05:13PM UTC by comment:5
This is caused by a88d64514001867b908776e6bfcfac7f1011970d.
Changed May 22, 2013 05:28PM UTC by comment:6
keywords: | → regression |
---|---|
milestone: | none → 1.11.0 |
priority: | minor → blocker |
Changed May 29, 2013 04:18PM UTC by comment:7
owner: | → mikesherov |
---|---|
status: | open → assigned |
Changed June 05, 2013 10:03AM UTC by comment:9
Draggable is affected since 1.10.3, simple demo here
no scrolling before dragging, clone is ok
scrolling down before dragging, clone is ko
when no clone, no bug.
Changed June 18, 2013 02:15AM UTC by comment:10
#9379 is a possible duplicate.
Changed June 27, 2013 12:27PM UTC by comment:11
_comment0: | I'm moving this ticket to ui.draggable it's a generic problem than just dialogs. → 1374064616971028 |
---|---|
component: | ui.dialog → ui.draggable |
summary: | Draggable dialog jumps down with offset of scrollbar → Draggable: jumps down with offset of scrollbar |
I'm moving this ticket to ui.draggable it's a more generic problem than just dialogs.
Changed June 27, 2013 12:27PM UTC by comment:12
#9405 is a duplicate of this ticket.
Changed July 17, 2013 04:36AM UTC by comment:13
Do we currently have any workaround for this issue?
Changed July 18, 2013 09:54AM UTC by comment:14
Replying to [comment:13 guhelouis]:
Do we currently have any workaround for this issue?
At the moment, no.
Changed July 20, 2013 09:25PM UTC by comment:15
#9442 is a duplicate of this ticket.
Changed July 24, 2013 12:25PM UTC by comment:16
#9447 is a duplicate of this ticket.
Changed July 28, 2013 08:08PM UTC by comment:17
#9461 is a duplicate of this ticket.
Changed August 07, 2013 10:34PM UTC by comment:18
I'll have a solution for this shortly.
Changed August 08, 2013 12:49PM UTC by comment:19
keywords: | regression → regression, blink |
---|
Ultimately, this needs to needs to be fixed in blink, and is caused by https://code.google.com/p/chromium/issues/detail?id=157855 I'll workaround it for now, but this should be fixed upstream.
Changed August 12, 2013 09:34AM UTC by comment:20
I found this as well, in my test it happens in all IE browsers (8/9/10) and FF:
here's the test:
Changed August 12, 2013 11:39PM UTC by comment:21
resolution: | → fixed |
---|---|
status: | assigned → closed |
Draggable: Ignore scroll offsets for abspos draggables. Fixes #9315 - Draggable: jumps down with offset of scrollbar
Changeset: 263d07894493aafcdc6a565f9f9c079b4b8f5d80
Changed August 20, 2013 12:05AM UTC by comment:22
I believe this affects ui.sortable as well.
Check with Firefox/IE. Scroll down then drag one of the elements.
Changed August 27, 2013 10:38AM UTC by comment:23
#9517 is a duplicate of this ticket.
Changed August 30, 2013 04:58AM UTC by comment:24
_comment0: | Hi, \ \ changeset 263d07894493aafcdc6a565f9f9c079b4b8f5d80 does not solve the problem for me ([http://jsfiddle.net/Sce5e/1/]). \ \ The only workaround has been for me to replace \ \ {{{ if (!this.offset.scroll) { }}} \ \ by \ \ {{{ if (!this.offset.scroll || scroll) { }}} \ \ in the implementations of _convertPositionTo and _generatePosition in jquery.ui.draggable.js. \ One can add a test to see if the scroll values have changed but it's probably faster not to do the test. \ \ Indeed, this.offset.scroll is never updated when the scroll changes (only set once when dragging starts). In version 1.10.2, the returned values are calculated using scroll.scrollTop() and scroll.scrollLeft() instead of this.offset.scroll.top and this.offset.scroll.left as it is in version 1.10.3. \ → 1377851525552987 |
---|---|
_comment1: | Hi, \ \ changeset 263d07894493aafcdc6a565f9f9c079b4b8f5d80 does not solve the problem for me ([http://jsfiddle.net/Sce5e/1/]). \ \ The workaround I found is to replace \ \ {{{ if (!this.offset.scroll) { }}} \ \ by \ \ {{{ if (!this.offset.scroll || scroll && (scroll.scrollTop() != this.offset.scroll.top || scroll.scrollLeft() != this.offset.scroll.left)) { }}} \ \ in the implementations of _convertPositionTo and _generatePosition in jquery.ui.draggable.js. \ It may even be faster to completely remove the conditional block so that \ \ {{{ this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()}; }}} is always executed. \ \ Indeed, this.offset.scroll is never updated when the scroll changes (it is only set once when dragging starts and this.offset.scroll is false). In version 1.10.2, the returned values are calculated using scroll.scrollTop() and scroll.scrollLeft() instead of this.offset.scroll.top and this.offset.scroll.left as it is in version 1.10.3. \ → 1377851558155824 |
_comment2: | Hi, \ \ changeset 263d07894493aafcdc6a565f9f9c079b4b8f5d80 does not solve the problem for me ([http://jsfiddle.net/Sce5e/1/]). \ \ The workaround I found is to replace \ \ {{{ if (!this.offset.scroll) { }}} \ \ by \ \ {{{ if (!this.offset.scroll || scroll && (scroll.scrollTop() != this.offset.scroll.top || scroll.scrollLeft() != this.offset.scroll.left)) { }}} \ \ in the implementations of _convertPositionTo and _generatePosition in jquery.ui.draggable.js. \ It may even be faster to completely remove the conditional block so that {{{ this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()}; }}} is always executed. \ \ Indeed, this.offset.scroll is never updated when the scroll changes (it is only set once when dragging starts and this.offset.scroll is false). In version 1.10.2, the returned values are calculated using scroll.scrollTop() and scroll.scrollLeft() instead of this.offset.scroll.top and this.offset.scroll.left as it is in version 1.10.3. \ → 1377851629682375 |
_comment3: | Hi, \ \ changeset 263d07894493aafcdc6a565f9f9c079b4b8f5d80 does not solve the problem for me ([http://jsfiddle.net/Sce5e/1/]). \ \ The workaround I found is to replace \ \ {{{ if (!this.offset.scroll) { }}} \ \ by \ \ {{{ if (!this.offset.scroll || scroll && (scroll.scrollTop() != this.offset.scroll.top || scroll.scrollLeft() != this.offset.scroll.left)) { }}} \ \ in the implementations of _convertPositionTo and _generatePosition in jquery.ui.draggable.js. \ The execution is even probably if the condition is removed so that {{{ this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()}; }}} is always executed. \ \ Indeed, this.offset.scroll is never updated when the scroll changes (it is only set once when dragging starts and this.offset.scroll is false). In version 1.10.2, the returned values are calculated using scroll.scrollTop() and scroll.scrollLeft() instead of this.offset.scroll.top and this.offset.scroll.left as it is in version 1.10.3. \ → 1377851767450887 |
_comment4: | Hi, \ \ changeset 263d07894493aafcdc6a565f9f9c079b4b8f5d80 does not solve the problem for me ([http://jsfiddle.net/Sce5e/1/]). \ \ The workaround I found is to replace \ \ {{{ if (!this.offset.scroll) { }}} \ \ by \ \ {{{ if (!this.offset.scroll || scroll && (scroll.scrollTop() != this.offset.scroll.top || scroll.scrollLeft() != this.offset.scroll.left)) { }}} \ \ in the implementations of _convertPositionTo and _generatePosition in jquery.ui.draggable.js. \ The execution is probably even faster if the condition is removed so that {{{ this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()}; }}} is always executed. \ \ Indeed, this.offset.scroll is never updated when the page/container is scrolled (it is only set once when dragging starts and this.offset.scroll is false). In version 1.10.2, the returned values are calculated using scroll.scrollTop() and scroll.scrollLeft() in the return statement instead of using the (fixed) values from this.offset.scroll as it is in version 1.10.3. \ → 1377851808259826 |
Hi,
changeset 263d07894493aafcdc6a565f9f9c079b4b8f5d80 does not solve the problem for me (http://jsfiddle.net/Sce5e/1/).
The workaround I found is to replace
if (!this.offset.scroll) {
by
if (!this.offset.scroll || scroll.scrollTop() != this.offset.scroll.top || scroll.scrollLeft() != this.offset.scroll.left) {
in the implementations of _convertPositionTo and _generatePosition in jquery.ui.draggable.js.
The execution is probably even faster if the condition is removed so that
this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};is always executed.
Indeed, this.offset.scroll is never updated when the page/container is scrolled (it is only set once when dragging starts and this.offset.scroll is false). In version 1.10.2, the returned values are calculated using scroll.scrollTop() and scroll.scrollLeft() in the return statement instead of using the (fixed) values from this.offset.scroll as it is in version 1.10.3.
Changed August 30, 2013 12:01PM UTC by comment:25
Replying to [comment:24 tkhyn]:
Hi, changeset 263d07894493aafcdc6a565f9f9c079b4b8f5d80 does not solve the problem for me (http://jsfiddle.net/Sce5e/1/). The workaround I found is to replaceif (!this.offset.scroll) {byif (!this.offset.scroll || scroll.scrollTop() != this.offset.scroll.top || scroll.scrollLeft() != this.offset.scroll.left) {in the implementations of _convertPositionTo and _generatePosition in jquery.ui.draggable.js. The execution is probably even faster if the condition is removed so thatthis.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};is always executed. Indeed, this.offset.scroll is never updated when the page/container is scrolled (it is only set once when dragging starts and this.offset.scroll is false). In version 1.10.2, the returned values are calculated using scroll.scrollTop() and scroll.scrollLeft() in the return statement instead of using the (fixed) values from this.offset.scroll as it is in version 1.10.3.
263d07894493aafcdc6a565f9f9c079b4b8f5d80 is in master and slated for 1.11. It is not in 1.10.3 which your test case is using.
Changed August 30, 2013 09:29PM UTC by comment:26
_comment0: | Replying to [comment:25 tj.vantoll]: \ > 263d07894493aafcdc6a565f9f9c079b4b8f5d80 is in master and slated for 1.11. It is not in 1.10.3 which your test case is using. \ I'm aware of that, thanks. The test case is only there to show you the code I was using. \ To test if the changeset fixed the problem, I used the draggable.js from the repository on MY machine. → 1377898612400705 |
---|---|
_comment1: | Replying to [comment:25 tj.vantoll]: \ > 263d07894493aafcdc6a565f9f9c079b4b8f5d80 is in master and slated for 1.11. It is not in 1.10.3 which your test case is using. \ I'm aware of that, thanks. The test case is only there to show you the code I was using, as I have no knowledge of a way to include the master version in jsfiddle. \ \ To test if the changeset fixed the problem, I got the draggable.js from the master and tested it on my machine. This did not fix the problem, and this is normal as the changeset does not correct the issue I explain in the above message. \ \ In my opinion, this ticket should therefore be reopeoned. → 1377899569453127 |
Replying to [comment:25 tj.vantoll]:
263d07894493aafcdc6a565f9f9c079b4b8f5d80 is in master and slated for 1.11. It is not in 1.10.3 which your test case is using.
I'm aware of that, thanks. The test case is only there to show you the code I was using, as I had no knowledge of a way to include the master version in jsfiddle.
To test if the changeset fixed the problem, I got the draggable.js from the master and tested it on my machine. This did not fix the problem, and this is normal as the changeset does not correct the issue I explain in the above message.
In my opinion, this ticket should therefore be reopeoned.
EDIT : found a way to include jquery-ui master (sorry, I should have tried to do that before). Edited my fiddle accordingly http://jsfiddle.net/Sce5e/4/. Bug still there
Changed August 31, 2013 03:02AM UTC by comment:27
Replying to [comment:26 tkhyn]:
Replying to [comment:25 tj.vantoll]: > 263d07894493aafcdc6a565f9f9c079b4b8f5d80 is in master and slated for 1.11. It is not in 1.10.3 which your test case is using. I'm aware of that, thanks. The test case is only there to show you the code I was using, as I had no knowledge of a way to include the master version in jsfiddle. To test if the changeset fixed the problem, I got the draggable.js from the master and tested it on my machine. This did not fix the problem, and this is normal as the changeset does not correct the issue I explain in the above message. In my opinion, this ticket should therefore be reopeoned. EDIT : found a way to include jquery-ui master (sorry, I should have tried to do that before). Edited my fiddle accordingly http://jsfiddle.net/Sce5e/4/. Bug still there
Ok, I see the behavior and that it did not occur in 1.10.2 and does in 1.10.3 and master: http://jsfiddle.net/tj_vantoll/c4CDc/
This only seems to occur when
top: 0,
bottom: 0, and
overflow: autoare applied to the wrapper. If I remove any of those the issue is not present.
Although this is very similar I think this is a different problem. The bug for this ticket occurred only in Firefox and IE and your test case seems problematic in all browsers.
Could you explain why you need
overflow: autoin your test case? And then we'll probably want to create a new ticket for your problem.
Thanks.
Changed August 31, 2013 06:31AM UTC by comment:28
_comment0: | Replying to [comment:27 tj.vantoll]: \ > Could you explain why you need {{{overflow: auto}}} in your test case? And then we'll probably want to create a new ticket for your problem. \ \ In my case I want the #page_wrapper to be scrolled, and keep the header at the top of the window out of the scrollable area (and the scrollbar). It may be done in another way in my particular case to make the draggables work but the bug seems to affect any draggable inside an absolutely positioned scrollable element (which is not that uncommon I guess). \ \ Sorry for having 'polluted' this ticket with an issue which is indeed different and deserves a new ticket, after a second read. I had read too many tickets about scrolling and draggable before posting and landed here :). → 1377931959393786 |
---|
Replying to [comment:27 tj.vantoll]:
Could you explain why you needoverflow: autoin your test case? And then we'll probably want to create a new ticket for your problem.
In my case I want only the #page_wrapper and not the body to be scrollable, so that the header is kept out of the scrollable area (and the scrollbar). It may be achieved in another way in my particular case to make the draggables work but the bug seems to affect any draggable inside an absolutely positioned scrollable element (which is not that uncommon I guess).
Sorry for having 'polluted' this ticket with an issue which - after a second reading - is indeed different and would definitely deserve a new ticket. I had read too many tickets about scrolling and draggables before posting and landed here :).
Changed August 31, 2013 01:56PM UTC by comment:29
Replying to [comment:28 tkhyn]:
Replying to [comment:27 tj.vantoll]: > Could you explain why you needoverflow: autoin your test case? And then we'll probably want to create a new ticket for your problem. In my case I want only the #page_wrapper and not the body to be scrollable, so that the header is kept out of the scrollable area (and the scrollbar). It may be achieved in another way in my particular case to make the draggables work but the bug seems to affect any draggable inside an absolutely positioned scrollable element (which is not that uncommon I guess). Sorry for having 'polluted' this ticket with an issue which - after a second reading - is indeed different and would definitely deserve a new ticket. I had read too many tickets about scrolling and draggables before posting and landed here :).
Thanks, that helps. Actually what you're experiencing is covered by #9379. I'll add your test case there.
Changed September 09, 2013 05:13PM UTC by comment:30
#9545 is a duplicate of this ticket.
Changed September 11, 2013 01:56PM UTC by comment:31
#9548 is a duplicate of this ticket.
Changed September 15, 2013 07:40PM UTC by comment:32
#9556 is a duplicate of this ticket.
Changed September 19, 2013 12:41PM UTC by comment:33
#9560 is a duplicate of this ticket.
Changed October 02, 2013 01:54PM UTC by comment:34
keywords: | regression, blink → regression |
---|
This is now fixed in Webkit and Blink: https://bugs.webkit.org/show_bug.cgi?id=106133 and https://code.google.com/p/chromium/issues/detail?id=157855
Changed October 06, 2013 08:07PM UTC by comment:35
#9589 is a duplicate of this ticket.
Changed October 23, 2013 12:52PM UTC by comment:36
#9614 is a duplicate of this ticket.
Changed December 04, 2013 03:00PM UTC by comment:37
#9687 is a duplicate of this ticket.
Changed December 05, 2013 06:49PM UTC by comment:38
#9692 is a duplicate of this ticket.
Changed December 09, 2013 01:22PM UTC by comment:39
#9699 is a duplicate of this ticket.
Changed January 08, 2014 01:24PM UTC by comment:40
#9729 is a duplicate of this ticket.
Changed January 11, 2014 11:05PM UTC by comment:41
#9736 is a duplicate of this ticket.
Changed January 22, 2014 01:34PM UTC by comment:42
#9763 is a duplicate of this ticket.
Changed January 22, 2014 05:30PM UTC by comment:43
#9765 is a duplicate of this ticket.
Changed February 10, 2014 05:43PM UTC by comment:44
Something in Chrome seems to have changed to break this again.
To observe the broken behaviour in Chrome v32.0.1700.107, go to ThemeRoller (http://jqueryui.com/themeroller/) and open a dialog box. The box will jump down the page when you click on the drag handle.
Changed February 10, 2014 05:55PM UTC by comment:45
That page is using 1.10.4, which doesn't contain this fix.
Changed February 10, 2014 06:27PM UTC by comment:46
#9807 is a duplicate of this ticket.
Changed February 15, 2014 02:25AM UTC by comment:47
#9828 is a duplicate of this ticket.
Changed February 26, 2014 03:14PM UTC by comment:48
#9836 is a duplicate of this ticket.
Changed February 26, 2014 03:14PM UTC by comment:49
#9835 is a duplicate of this ticket.
Changed March 10, 2014 06:21PM UTC by comment:50
#9910 is a duplicate of this ticket.
Changed March 10, 2014 08:23PM UTC by comment:51
1.10.4 still has this problem, it is not fixed
Changed March 10, 2014 08:26PM UTC by comment:52
Replying to [comment:51 cyxjqui]:
1.10.4 still has this problem, it is not fixed
As the milestone says, the fix will be released in 1.11.0.
Changed March 27, 2014 02:00PM UTC by comment:53
#9936 is a duplicate of this ticket.
Changed March 28, 2014 04:22PM UTC by comment:54
#9941 is a duplicate of this ticket.
Changed April 06, 2014 09:42PM UTC by comment:55
#9967 is a duplicate of this ticket.
Changed April 11, 2014 07:36PM UTC by comment:56
#9976 is a duplicate of this ticket.
Changed May 16, 2014 06:07PM UTC by comment:57
#10046 is a duplicate of this ticket.
Changed May 24, 2014 12:13PM UTC by comment:58
#10066 is a duplicate of this ticket.
Changed May 26, 2014 04:36PM UTC by comment:59
#9962 is a duplicate of this ticket.
Changed June 02, 2014 01:54PM UTC by comment:60
#10080 is a duplicate of this ticket.
Changed July 03, 2014 03:54AM UTC by comment:61
_comment0: | This problem still occurs in chrome with version 1.11.0 \ \ You can see this at [http://webrecipemanager.com] login with user demo p/w demo99 \ \ Select shopping list under Menu Planning \ \ Load saved menu from the dropdown then scroll down and try dragging one of the shopping list items → 1404360095129180 |
---|
Changed July 03, 2014 06:42AM UTC by comment:62
Using ui 1.11.0 this issue still occurs in chrome Version 35.0.1916.153
Changed July 03, 2014 12:23PM UTC by comment:63
Replying to [comment:62 barb]:
Using ui 1.11.0 this issue still occurs in chrome Version 35.0.1916.153
Please include a test case that shows the issue.
Changed September 10, 2014 05:00AM UTC by comment:64
_comment0: | Hello, \ \ Is this issue resolved, or any workaround. → 1410325934080222 |
---|---|
_comment1: | Hello, \ \ Is this issue resolved, or any workaround. \ \ Thanks → 1410342183634921 |
_comment2: | Hello, \ \ The other workaround is, you can use user agent and find the browser, apply the style \ {{{ \ html, body \ { \ position:relative; \ } \ }}} \ \ Is this issue resolved, or any workaround. \ \ Thanks → 1410342226272675 |
_comment3: | Hello, \ \ The other workaround is, you can use user agent and find the browser, apply the style \ {{{ \ html, body \ { \ position:relative; \ } \ }}} \ \ If anyone have a better workaround, please post. \ \ Thanks → 1510882887523553 |
Hello,
The other workaround is, you can use user agent and find the browser, apply the style
html, body { position:relative; }
If anyone have a better workaround, please post.
Thanks
Changed March 09, 2015 05:33PM UTC by comment:65
_comment0: | The above workaround by arjun didn't work in all browsers for me. As of today (March 9, 2015), the following CSS is the best workaround I've found. This works for all major browsers I've tested (Firefox, Chrome, Opera, Safari, IE11, IE10). It does NOT work for Internet Explorer 9 and below - I just disable the draggables for old IE: \ \ /* \ * Hack to fix weird jquery ui draggable 'containment' issue when page is not scrolled to top \ * See http://bugs.jqueryui.com/ticket/9315 \ */ \ @media screen and (-webkit-min-device-pixel-ratio:0) { /* chrome */ \ html{ \ position: relative; \ } \ } \ @-moz-document url-prefix() { /* firefox */ \ body{ \ position: relative; \ overflow: auto; \ } \ } \ @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { /* ie10+ */ \ body{ \ position: relative; \ overflow: auto; \ } \ } → 1510882847531492 |
---|
The above workaround by arjun didn't work in all browsers for me. As of today (March 9, 2015), the following CSS is the best workaround I've found. This works for all major browsers I've tested (Firefox, Chrome, Opera, Safari, IE11, IE10). It does NOT work for Internet Explorer 9 and below - I just disable the draggables for old IE:
/* * Hack to fix weird jquery ui draggable 'containment' issue when page is not scrolled to top * See http://bugs.jqueryui.com/ticket/9315 */ @media screen and (-webkit-min-device-pixel-ratio:0) { /* chrome */ html{ position: relative; } } @-moz-document url-prefix() { /* firefox */ body{ position: relative; overflow: auto; } } @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { /* ie10+ */ body{ position: relative; overflow: auto; } }
Changed November 16, 2017 08:10AM UTC by comment:66
Nothing above worked for us in any version of 1.10.x. The following CSS solved it though.
Our issue was mostly in Chrome if you're scrolled down the page and using the draggable:
#!css header, nav, main, footer, article, section, summary{ position: relative; }
I can confirm this issue and that it is a 1.10.3 regression. This is likely a draggable issue so I want to try to recreate this without a dialog. Hopefully that will help to pin down which of the 6 draggable fixes that landed in 1.10.3 might be suspect.