Skip to main content

Search and Top Navigation

#4823 closed bug (invalid)

Opened September 01, 2009 10:11AM UTC

Closed November 09, 2012 09:09AM UTC

Droppable tolerance "intersect" did not work properly when in exact grid

Reported by: fjosefsson Owned by: fjosefsson
Priority: minor Milestone: 2.0.0
Component: ui.draggable Version: 1.7.2
Keywords: droppable Cc:
Blocked by: Blocking:
Description

I have created a draggable object with its "grid" property having a width exactly as wide as the droppable object. The draggable object is precisely so wide that it fit over one or more droppable objects (example: three droppable objects are 50px 50px 50px 50px 50px, the draggable object is 100px, and the grid property has a width of 100).

It did not work -- ie it reported "false" -- when there were exactly two fields for it to span over. It worked with three fields. I did not try with more or less fields.

I changed

	case 'intersect':
			return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
				&& x2 - (draggable.helperProportions.width / 2) < r // Left Half
				&& t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
				&& y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
			break;

into

	case 'intersect':
			return (l <= x1 + (draggable.helperProportions.width / 2) // Right Half
				&& x2 - (draggable.helperProportions.width / 2) < r // Left Half
				&& t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
				&& y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
			break;

and it worked.

Maybe you can confirm?

Perhaps the same change needs to be done with "&& t < y1 + (draggable.helperProportions.height / 2)" , if height of the draggable must match the height of one more droppables.

Attachments (0)
Change History (4)

Changed November 16, 2009 11:29AM UTC by jzaefferer comment:1

component: ui.coreui.draggable
milestone: TBD1.8

Changed October 11, 2012 02:49PM UTC by scottgonzalez comment:2

milestone: 1.9.02.0.0

Changed October 25, 2012 01:28PM UTC by petersendidit comment:3

owner: → fjosefsson
status: newpending

Thanks for taking the time to contribute to the jQuery UI project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the git version of both jQuery UI and jQuery to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/ZgAqH/Open the link and click to "Fork" (in the top menu) to get started.

Changed November 09, 2012 09:09AM UTC by trac-o-bot comment:4

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!