Opened 9 years ago
Closed 9 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:
- Expose
$.ui.intersect
(or something similar) again. - Expose an extendable hash of intersection functions (see ticket:4737).
- Change the
tolerance
option to be of type "String or Function". The function would takedraggable
,droppable
, andevent
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.
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.