Opened 10 years ago

Closed 6 years ago

#4823 closed bug (invalid)

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.

Change History (4)

comment:1 Changed 9 years ago by Jörn Zaefferer

Component: ui.coreui.draggable
Milestone: TBD1.8

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

Milestone: 1.9.02.0.0

comment:3 Changed 6 years ago by petersendidit

Owner: set to 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.

comment:4 Changed 6 years ago by trac-o-bot

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!

Note: See TracTickets for help on using tickets.