| 371 | } |
| 372 | |
| 373 | cancelEvent(e: Event): void { |
| 374 | // Allow focusin and focusout on the drag target so focus ring works properly. |
| 375 | let eventTarget = getEventTarget(e); |
| 376 | if ( |
| 377 | (e.type === 'focusin' || e.type === 'focusout') && |
| 378 | (eventTarget === this.dragTarget?.element || eventTarget === this.getCurrentActivateButton()) |
| 379 | ) { |
| 380 | return; |
| 381 | } |
| 382 | |
| 383 | // Allow default for events that might cancel a click event |
| 384 | if (!CLICK_EVENTS.includes(e.type)) { |
| 385 | e.preventDefault(); |
| 386 | } |
| 387 | |
| 388 | e.stopPropagation(); |
| 389 | e.stopImmediatePropagation(); |
| 390 | } |
| 391 | |
| 392 | updateValidDropTargets(): void { |
| 393 | if (!this.mutationObserver) { |