Opened 6 years ago

Closed 6 years ago

#9421 closed bug (duplicate)

iframe: positions of droppables while dragging from parent not correct.

Reported by: Solid Owned by:
Priority: minor Milestone: none
Component: ui.droppable Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description

Here is demonstration how this is failing: http://jsfiddle.net/bq9fj/

What's happening is the droppable positions inside are missing its parent iframe offset.

This is a draft of the solution in $.ui.ddmanager.prepareOffsets below m[i].offset :

if (t.document[0] != m[i].document[0]) { 
	var frames = t.document[0].getElementsByTagName('iframe');
	for (var x = frames.length; x-- > 0;) {
		if (frames[x].contentWindow.document === m[i].document[0]) {
			var frame = $(frames[x]).offset();
			m[i].offset.left += frame.left;
			m[i].offset.top += frame.top;
		}
	}
}

here is example of it fixed: http://jsfiddle.net/4C7Kw/

It still needs nested iframe detection.

unlikely for someone to have .draggable > iframe > iframe > .droppable, but is possible for consideration.

Thanks.

Change History (1)

comment:1 Changed 6 years ago by Scott González

Resolution: duplicate
Status: newclosed

Duplicate of #7925.

Note: See TracTickets for help on using tickets.