MCPcopy Index your code
hub / github.com/adobe/react-spectrum / end

Method end

packages/react-aria/src/dnd/DragManager.ts:601–627  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

599 }
600
601 end(): void {
602 this.teardown();
603 endDragging();
604
605 if (typeof this.dragTarget.onDragEnd === 'function') {
606 let target =
607 this.currentDropTarget && this.dropOperation !== 'cancel'
608 ? this.currentDropTarget
609 : this.dragTarget;
610 let rect = target.element.getBoundingClientRect();
611 this.dragTarget.onDragEnd({
612 type: 'dragend',
613 x: rect.x + rect.width / 2,
614 y: rect.y + rect.height / 2,
615 dropOperation: this.dropOperation || 'cancel'
616 });
617 }
618
619 if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) {
620 // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).
621 // This corrects state such as whether focus ring should appear.
622 // useDroppableCollection handles this itself, so this is only for standalone drop zones.
623 getActiveElement()?.dispatchEvent(new FocusEvent('focusin', {bubbles: true}));
624 }
625
626 this.setCurrentDropTarget(null);
627 }
628
629 cancel(): void {
630 this.setCurrentDropTarget(null);

Callers 10

cancelMethod · 0.95
dropMethod · 0.95
ssrWorker.jsFile · 0.80
testSSRFunction · 0.80
maybeRespondToPromptFunction · 0.80
runFixtureCLIFunction · 0.80
serveChangedPackagesMethod · 0.80
serveVersionBumpsMethod · 0.80
compareBuildAppSizeFunction · 0.80

Calls 4

teardownMethod · 0.95
setCurrentDropTargetMethod · 0.95
getActiveElementFunction · 0.90
endDraggingFunction · 0.70

Tested by 2

maybeRespondToPromptFunction · 0.64
runFixtureCLIFunction · 0.64