Bug Tracker

Ticket #2307 (closed bug: fixed)

Opened 10 months ago

Last modified 7 months ago

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

Reported by: rworth Assigned to: paul
Type: bug Priority: major
Milestone: 1.2.4 Component: ui
Version: 1.2.2 Keywords:
Cc: Needs: Review

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

Change History

Changed 10 months ago by paul

  • owner changed from paul to rworth

Changed 10 months ago by scott.gonzalez

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

Changed 9 months ago by rworth

  • status changed from new to assigned

Changed 9 months ago by scott.gonzalez

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 9 months ago by paul

  • owner changed from rworth to scott.gonzalez
  • status changed from assigned to new

Changed 8 months ago by scott.gonzalez

  • owner changed from scott.gonzalez to brandon
  • component changed from ui to offset
  • milestone changed from 1.2.3 to 1.2.4

Changed 8 months 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.

Changed 7 months ago by brandon

  • component changed from offset to ui

Changed 7 months ago by paul

  • status changed from new to closed
  • resolution set to fixed

Changed 7 months ago by paul

Should be fine now!

Note: See TracTickets for help on using tickets.