MCPcopy
hub / github.com/adobe/react-spectrum / cancel

Method cancel

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

Source from the content-addressed store, hash-verified

627 }
628
629 cancel(): void {
630 this.setCurrentDropTarget(null);
631 this.end();
632 if (!this.dragTarget.element.closest('[aria-hidden="true"], [inert]')) {
633 this.dragTarget.element.focus();
634 }
635
636 // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).
637 getActiveElement()?.dispatchEvent(new FocusEvent('focusin', {bubbles: true}));
638
639 announce(this.stringFormatter.format('dropCanceled'));
640 }
641
642 drop(item?: DroppableItem): void {
643 if (!this.currentDropTarget) {

Callers 13

onKeyDownMethod · 0.95
onClickMethod · 0.95
dropMethod · 0.95
useEnterAnimationFunction · 0.80
startAnimationFunction · 0.80
MobileFunction · 0.80
startAnimationFunction · 0.80
PressAnimationFunction · 0.80
MouseAnimationFunction · 0.80
ListBoxExampleFunction · 0.80
startAnimationFunction · 0.80

Calls 6

setCurrentDropTargetMethod · 0.95
endMethod · 0.95
getActiveElementFunction · 0.90
announceFunction · 0.90
focusMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected