Bug Tracker

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#2307 closed bug (fixed)

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:


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]

Change History (10)

comment:1 Changed 15 years ago by paul

Owner: changed from paul to rworth

comment:2 Changed 15 years ago by scott.gonzal

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

comment:3 Changed 15 years ago by rworth

Status: newassigned

comment:4 Changed 15 years ago by scott.gonzal

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.

comment:5 Changed 15 years ago by paul

Owner: changed from rworth to scott.gonzalez
Status: assignednew

comment:6 Changed 15 years ago by scott.gonzal

Component: uioffset
Owner: changed from scott.gonzalez to brandon

comment:7 Changed 15 years ago by brandon

Owner: changed from brandon to paul

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.

comment:8 Changed 15 years ago by brandon

Component: offsetui

comment:9 Changed 15 years ago by paul

Resolution: fixed
Status: newclosed

comment:10 Changed 15 years ago by paul

Should be fine now!

Note: See TracTickets for help on using tickets.