// ignore drop/paste events if they are not in input or textarea — // otherwise when Url plugin adds drop/paste listeners to this.el, // draging UI elements or pasting anything into any field triggers those events — // Url treats them as URLs that need to be imported import type { TargetedEvent } from 'preact' function ignoreEvent(ev: TargetedEvent): void { const { tagName } = ev.target as Element if (tagName === 'INPUT' || tagName === 'TEXTAREA') { ev.stopPropagation() return } ev.preventDefault() ev.stopPropagation() } export default ignoreEvent