@ai-matrx/design-system 0.61.15 → 0.61.16

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.js CHANGED
@@ -415,18 +415,20 @@ function overflowPast(el, rect, view) {
415
415
  }
416
416
  let clip = null;
417
417
  let transformed = false;
418
+ let pannedInsideClip = false;
418
419
  const root = el.ownerDocument.documentElement;
419
420
  for (let p = el.parentElement; p && p !== root; p = p.parentElement) {
420
421
  const pcs = view.getComputedStyle(p);
421
422
  if (!clip && pcs.overflowX !== "visible" && pcs.overflowX !== "") clip = p;
422
423
  if (pcs.transform && pcs.transform !== "none" || pcs.translate && pcs.translate !== "none" || pcs.scale && pcs.scale !== "none" || pcs.rotate && pcs.rotate !== "none") {
423
424
  transformed = true;
425
+ if (!clip) pannedInsideClip = true;
424
426
  }
425
427
  }
426
428
  if (clip && !pinned && clip !== parent) {
427
429
  const cr = clip.getBoundingClientRect();
428
430
  if (cr.width > 0) {
429
- const by = Math.max(rect.right - cr.right, cr.left - rect.left);
431
+ const by = pannedInsideClip ? rect.width - cr.width : Math.max(rect.right - cr.right, cr.left - rect.left);
430
432
  if (by > 0.5) return { what: "its clipping container", by };
431
433
  }
432
434
  }