Skip to main content

Search and Top Navigation

#2307 closed bug (fixed)

Opened February 08, 2008 04:04PM UTC

Closed May 03, 2008 06:31AM UTC

Last modified February 26, 2009 11:28AM UTC

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

Reported by: rworth Owned by: paul
Priority: major Milestone: 1.5
Component: ui.core 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 (12)

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

owner: paulrworth

Changed February 13, 2008 01:47AM UTC by scottgonzalez comment:2

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

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

status: newassigned

Changed March 14, 2008 04:18PM UTC by scottgonzalez 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 scottgonzalez 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!

Changed May 24, 2008 03:39AM UTC by comment:11

milestone: 1.2.4

Milestone 1.2.4 deleted

Changed February 26, 2009 11:28AM UTC by paul comment:12

milestone: → 1.5