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

Function findValidDropTargets

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

getTypesFunction · 0.90
getDropOperationMethod · 0.80
filterMethod · 0.65

Tested by

no test coverage detected