@tedi-design-system/angular 7.1.0-rc.15 → 7.1.0-rc.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.
@@ -9328,22 +9328,26 @@ class PopoverComponent {
9328
9328
  }
9329
9329
  }
9330
9330
  /**
9331
- * Whether the event target belongs to this popover's own overlay, or to a
9332
- * nested overlay opened from inside it.
9331
+ * Whether the target is inside this popover's own overlay or a child overlay
9332
+ * opened from within it — such interactions must not dismiss the popover.
9333
9333
  *
9334
- * Nested overlays (e.g. a month/year dropdown in the date-picker header)
9335
- * render in their own pane within the shared CDK overlay container, not
9336
- * inside this popover's overlayElement. Interacting with, focusing into or
9337
- * scrolling such a child overlay must not dismiss the popover, so anything
9338
- * inside the overlay container counts as internal.
9334
+ * Child overlays (e.g. a date-picker month dropdown) share the CDK overlay
9335
+ * container but render in their own pane, stacked ON TOP (after this pane in
9336
+ * DOM order). An overlay stacked BELOW (e.g. a tedi-modal hosting this
9337
+ * popover) precedes this pane, so clicking it must dismiss.
9339
9338
  */
9340
9339
  isInsideOverlay(target) {
9341
- if (!target)
9340
+ if (!target || !(target instanceof Element))
9342
9341
  return false;
9343
9342
  const overlayEl = this.connectedOverlay()?.overlayRef?.overlayElement;
9344
- if (overlayEl?.contains(target))
9343
+ if (!overlayEl)
9344
+ return false;
9345
+ if (overlayEl.contains(target))
9345
9346
  return true;
9346
- return (target instanceof Element && !!target.closest(".cdk-overlay-container"));
9347
+ if (!target.closest(".cdk-overlay-container"))
9348
+ return false;
9349
+ return !!(overlayEl.compareDocumentPosition(target) &
9350
+ Node.DOCUMENT_POSITION_FOLLOWING);
9347
9351
  }
9348
9352
  handleClosePopoverEvent(e) {
9349
9353
  const triggerEl = this.popoverTrigger().host.nativeElement;