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

Function isInternalDropOperation

packages/react-aria/src/dnd/utils.ts:411–417  ·  view source on GitHub ↗
(ref?: RefObject<HTMLElement | null>)

Source from the content-addressed store, hash-verified

409// Util function to check if the current dragging collection ref is the same as the current targeted droppable collection ref.
410// Allows a droppable ref arg in case the global drop collection ref hasn't been set
411export function isInternalDropOperation(ref?: RefObject<HTMLElement | null>): boolean {
412 let {draggingCollectionRef, dropCollectionRef} = globalDndState;
413 return (
414 draggingCollectionRef?.current != null &&
415 draggingCollectionRef.current === (ref?.current || dropCollectionRef?.current)
416 );
417}
418
419type DropEffect = 'none' | 'copy' | 'link' | 'move';
420export let globalDropEffect: DropEffect | undefined;

Callers 9

onDragEndFunction · 0.90
getDropOperationFunction · 0.90
useDroppableItemFunction · 0.90
useDroppableCollectionFunction · 0.90
getDropOperationForPointFunction · 0.90
nextValidTargetFunction · 0.90
getDropOperationFunction · 0.90
onDropEnterFunction · 0.90
onKeyDownFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected