Opened 15 years ago

Closed 15 years ago

Last modified 14 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.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]

Change History (12)

comment:1 Changed 15 years ago by paul

Owner: changed from paul to rworth

comment:2 Changed 15 years ago by Scott González

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

comment:3 Changed 15 years ago by rdworth

Status: newassigned

comment:4 Changed 15 years ago by Scott González

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 González

Component: uioffset
Milestone: 1.2.31.2.4
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!

comment:11 Changed 15 years ago by (none)

Milestone: 1.2.4

Milestone 1.2.4 deleted

comment:12 Changed 14 years ago by paul

Milestone: 1.5
Note: See TracTickets for help on using tickets.