MCPcopy Index your code
hub / github.com/SortableJS/Sortable / getChildContainingRectFromElement

Function getChildContainingRectFromElement

src/utils.js:544–560  ·  view source on GitHub ↗
(container, options, ghostEl)

Source from the content-addressed store, hash-verified

542}
543
544function getChildContainingRectFromElement(container, options, ghostEl) {
545 const rect = {};
546
547 Array.from(container.children).forEach(child => {
548 if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
549 const childRect = getRect(child);
550 rect.left = Math.min(rect.left ?? Infinity, childRect.left);
551 rect.top = Math.min(rect.top ?? Infinity, childRect.top);
552 rect.right = Math.max(rect.right ?? -Infinity, childRect.right);
553 rect.bottom = Math.max(rect.bottom ?? -Infinity, childRect.bottom);
554 });
555 rect.width = rect.right - rect.left;
556 rect.height = rect.bottom - rect.top;
557 rect.x = rect.left;
558 rect.y = rect.top;
559 return rect;
560}
561
562const expando = 'Sortable' + (new Date).getTime();
563

Callers 2

_ghostIsFirstFunction · 0.90
_ghostIsLastFunction · 0.90

Calls 2

closestFunction · 0.70
getRectFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…