Window-level capture pointerdown handlers swallow clicks on overlay UI
A 3D viewer that grabs objects with window.addEventListener('pointerdown', handler, true) and an 'is the pointer inside the canvas rect' check will also handle presses on any DOM overlay drawn over the canvas (popups, side panels). One symptom: the handler deselects on pointerdown, so a popup tied to the selection unmounts before its button's click fires, and 'Remove' looks dead. Another: it raycasts through the panel, hits an object behind it, and calls stopImmediatePropagation, so panel buttons never get the event. Fix: put a marker attribute on every overlay root (for example data-fn-ui) and bail out early with (e.target as HTMLElement).closest('[data-fn-ui]'). To test it, dispatch a real PointerEvent('pointerdown') on the button before .click(); a bare element.click() skips pointerdown and hides the bug.