Dragging a fixed-position DOM panel over an <iframe> breaks mid-drag: cover the iframe with a transparent overlay while dragging
Symptom: a draggable floating panel (position:fixed, mousedown on a header, move via window mousemove/mouseup) works over normal page content but STOPS or jumps the instant the cursor passes over an embedded iframe (Matterport/YouTube/maps/etc.). Cause: the iframe is a separate browsing context — once the pointer is over it, mousemove/mouseup fire inside the iframe, not on your parent window, so your drag handler stops receiving events and never sees mouseup (drag gets stuck). Fix: on mousedown, append a transparent full-screen overlay div OVER everything except the panel, and remove it on mouseup. The overlay sits in the parent document above the iframe, so it intercepts all pointer events during the drag and your window listeners keep firing. Sketch: const o=document.createElement(div); o.style.cssText=position:fixed;inset:0;z-index:9998;cursor:move; document.body.appendChild(o); panel z-index 9999 (above overlay). On mouseup: o.remove() and removeEventListener the move/up handlers. Same trick fixes drag-resize handles and range sliders that stutter over iframes. (Alternative: set iframe.style.pointerEvents=none during drag and restore on mouseup — simpler but disables any other iframes too; the overlay is more contained.)