Bug Tracker

Ticket #2431 (closed bug: fixed)

Opened 9 months ago

Last modified 8 months ago

Touch tolerance breaks when the draggable is taller than the droppable.

Reported by: jeffkretz Assigned to: braeker
Type: bug Priority: blocker
Milestone: 1.2.4 Component: ui
Version: 1.2.3 Keywords: tolerance
Cc: Needs: Patch

Description

See demo page at:

http://cobalt.scorpiontechnology.com/Test/HTMLPage.htm

Only the top and bottom edges of the draggable activate the droppable. When the draggable is centered over the droppable, it cannot be dropped.

JK

Attachments

Change History

Changed 9 months ago by jeffkretz

In stepping through the code, I see that the logic only detects for the presence of one corner inside another. So when the draggable is larger, it can overlap yet have no corner inside. This change solved the problem for me:

case 'touch':
	return ( (y1 >= t && y1 <= b) ||	// Top edge touching
		 (y2 >= t && y2 <= b) ||	// Bottom edge touching
		 (y1 < t && y2 > b)		// Surrounded vertically
		) && (
		 (x1 >= l && x1 <= r) ||	// Left edge touching
		 (x2 >= l && x2 <= r) ||	// Right edge touching
		 (x1 < l && x2 > r)		// Surrounded horizontally
		);

You can see this working at:

http://cobalt.scorpiontechnology.com/Test/HTMLPage2.htm

JK

Changed 9 months ago by paul

  • need changed from Review to Patch
  • owner changed from paul to rworth

Changed 9 months ago by paul

  • owner changed from rworth to paul

Changed 8 months ago by paul

  • owner changed from paul to braeker

Changed 8 months ago by braeker

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.