MCPcopy Create free account
hub / github.com/adobe/react-spectrum / findValidDropTargets

Function findValidDropTargets

packages/react-aria/src/dnd/DragManager.ts:702–715  ·  view source on GitHub ↗
(options: DragTarget)

Source from the content-addressed store, hash-verified

700}
701
702function findValidDropTargets(options: DragTarget) {
703 let types = getTypes(options.items);
704 return [...dropTargets.values()].filter(target => {
705 if (target.element.closest('[aria-hidden="true"], [inert]')) {
706 return false;
707 }
708
709 if (typeof target.getDropOperation === 'function') {
710 return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';
711 }
712
713 return true;
714 });
715}

Callers 1

Calls 3

getTypesFunction · 0.90
getDropOperationMethod · 0.80
filterMethod · 0.65

Tested by

no test coverage detected