Skip to main content

Search and Top Navigation

#11226 closed bug (duplicate)

Opened February 25, 2015 02:54PM UTC

Closed February 25, 2015 03:15PM UTC

Droppable: Provide way to override intersection calculation

Reported by: netnichols Owned by:
Priority: minor Milestone: none
Component: ui.droppable Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:
Description

A fairly recent commit makes the previously exposed $.ui.intersect function into a private function of droppable. This was

done to close ticket:10534.

https://github.com/jquery/jquery-ui/commit/20a636844961a1fb2de7a892ab28890091822e6a

Unfortunately, I (and I would assume others) are relying on being able to override that function. In my particular case I need to do it to make droppable play nicely with elements that have a css scale transformation (which presumably won't be handled by jQuery UI itself any time soon ticket:6844). Apart from my particular needs, it does seem like an official way of overriding the intersection calculation is a very handy and powerful feature.

I can think of three ways to offer this functionality:

1. Expose $.ui.intersect (or something similar) again.

2. Expose an extendable hash of intersection functions (see ticket:4737).

3. Change the tolerance option to be of type "String or Function". The function would take draggable, droppable, and event as arguments and return a boolean. (see http://api.jqueryui.com/droppable/#option-tolerance)

If the core team would agree with the request and have a clear preference on their preferred option, I would be happy to do the work myself and submit a pull request.

Attachments (0)
Change History (1)

Changed February 25, 2015 03:15PM UTC by scottgonzalez comment:1

resolution: → duplicate
status: newclosed

Duplicate of #4737.This is being handled properly in the interaction rewrite, see https://github.com/jquery/jquery-ui/blob/c15481eeb1806938ce2b3adfa1866e5a8a78fa31/ui/droppable.js#L164 which has an implementation for #4737.