Search and Top Navigation
#5569 closed bug (fixed)
Opened April 30, 2010 12:50PM UTC
Closed March 08, 2013 02:42AM UTC
Last modified March 08, 2013 02:43AM UTC
Draggable: Containment incorrectly calculates padding and border
Reported by: | Daazku | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.10.2 |
Component: | ui.draggable | Version: | 1.8 |
Keywords: | haspatch | Cc: | |
Blocked by: | Blocking: |
Description
Draggable containement calculation is wrong because
this.containment = [ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top ];
should be
this.containment = [ co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left, co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top, co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderRightWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left, co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderBottomWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top ];
(replaced borderLeftWidth by borderRightWidth for right containement and same for bottom)
Attachments (0)
Change History (7)
Changed October 11, 2012 09:07PM UTC by comment:1
milestone: | TBD → 2.0.0 |
---|
Changed October 26, 2012 04:03AM UTC by comment:2
keywords: | containement → haspatch |
---|---|
status: | new → open |
confirmed, the new location of the code is: https://github.com/jquery/jquery-ui/blob/039ee746d3eaeeaa4ad92ecd8ebf4e6fcd11768c/ui/jquery.ui.draggable.js#L381
Changed October 26, 2012 04:04AM UTC by comment:3
summary: | Containment size calculation is wrong. → Draggable: Containment incorrectly calculates padding and border |
---|
Changed January 23, 2013 02:46AM UTC by comment:4
Test case - http://jsfiddle.net/tj_vantoll/maP9S/. I verified that the recommended fix indeed fixes the problem.
Changed January 26, 2013 08:33PM UTC by comment:5
Pull request - https://github.com/jquery/jquery-ui/pull/896.
Changed March 08, 2013 02:42AM UTC by comment:6
resolution: | → fixed |
---|---|
status: | open → closed |
Draggable: Fix border containment. Fixed #5569 - Draggable: Containment incorrectly calculates padding and border
Changeset: 6358695df18722d8c7e99437365db42cf4957626
Changed March 08, 2013 02:43AM UTC by comment:7
milestone: | 2.0.0 → 1.10.2 |
---|