Opened 4 years ago

Closed 4 years ago

#11226 closed bug (duplicate)

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.

Change History (1)

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

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.

Note: See TracTickets for help on using tickets.