@ohhwells/bridge 0.1.55-next.165 → 0.1.55-next.168

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -7275,7 +7275,14 @@ function findClosestButtonLike(target) {
7275
7275
  function findButtonAtPoint(x, y, media) {
7276
7276
  const hits = Array.from(
7277
7277
  document.querySelectorAll(BUTTON_LIKE_SELECTOR)
7278
- ).filter((el) => containsPoint(el, x, y) && !(media && el.contains(media)));
7278
+ ).filter(
7279
+ (el) => containsPoint(el, x, y) && !(media && el.contains(media)) && // Bridge-injected chrome (e.g. MediaOverlay's own "Replace image" button) is never a
7280
+ // site button. Without this, once the media overlay renders its button lands right
7281
+ // under the cursor, gets detected as "a button on the media", and dismisses the very
7282
+ // overlay it belongs to — which removes the button, so the next hit-test finds nothing
7283
+ // and the overlay reappears. Flip-flops every tick: the "Replace image" button flashes.
7284
+ !el.closest("[data-ohw-bridge]")
7285
+ );
7279
7286
  if (hits.length === 0) return null;
7280
7287
  return hits.reduce((best, el) => best.contains(el) ? el : best);
7281
7288
  }