Skip to main content

Bug Tracker

Side navigation

#2307 closed bug (fixed)

Opened February 08, 2008 04:04PM UTC

Closed May 03, 2008 06:31AM UTC

Last modified May 03, 2008 06:31AM UTC

IE6: Dialog jumps up so mouse is at bottom of titlebar when dragged

Reported by: rworth Owned by: paul
Priority: major Milestone: 1.2.4
Component: ui Version: 1.2.2
Keywords: Cc:
Blocked by: Blocking:
Description

When you drag a dialog in IE6, it jumps up a little so the mouse cursor is at the bottom of the titlebar. See:

http://dev.jquery.com/view/trunk/ui/tests/uiTest.dialog.html

test: [default]

Attachments (0)
Change History (10)

Changed February 08, 2008 04:08PM UTC by paul comment:1

owner: paulrworth

Changed February 13, 2008 01:47AM UTC by scott.gonzal comment:2

This only occurs when there is a margin on the body element.

Changed February 26, 2008 05:16PM UTC by rworth comment:3

status: newassigned

Changed March 14, 2008 04:18PM UTC by scott.gonzal comment:4

I think the proper solution is to modify the offset() method to add on the body's margin if the element is absolutely positioned and a direct descendant of the body.

Changed March 14, 2008 06:53PM UTC by paul comment:5

owner: rworthscott.gonzalez
status: assignednew

Changed April 21, 2008 02:41PM UTC by scott.gonzal comment:6

component: uioffset
milestone: 1.2.31.2.4
owner: scott.gonzalezbrandon

Changed April 21, 2008 03:30PM UTC by brandon comment:7

owner: brandonpaul

I believe the issue is on line 163-4 of ui.draggable.js

this.offsetParentOffset = this.offsetParent.offset();
var elementPosition = { left: this.elementOffset.left - this.offsetParentOffset.left, top: this.elementOffset.top - this.offsetParentOffset.top };

The offsetParent is the body element and in IE6 it is reporting the margin which you obviously do not want to actually apply when an element is absolute. It looks like you are trying to get the position of an element. Unfortunately just subtracting two offsets will not give you the real position. Check out the dimensions position method for getting the position of an element relative to its true offsetParent. As a side note, the offset method doesn't officially support the body element.

Let me know if I've missed anything or if I can help out.

Changed April 22, 2008 05:51AM UTC by brandon comment:8

component: offsetui

Changed May 03, 2008 06:31AM UTC by paul comment:9

resolution: → fixed
status: newclosed

Changed May 03, 2008 06:31AM UTC by paul comment:10

Should be fine now!