@angular/cdk 21.1.0-next.3 → 21.1.0-rc.0

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2025 Google LLC.
3
+ Copyright (c) 2026 Google LLC.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1143,7 +1143,7 @@ class FlexibleConnectedPositionStrategy {
1143
1143
  this._viewportRect = this._getNarrowedViewportRect();
1144
1144
  this._originRect = this._getOriginRect();
1145
1145
  this._overlayRect = this._pane.getBoundingClientRect();
1146
- this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
1146
+ this._containerRect = this._getContainerRect();
1147
1147
  const originRect = this._originRect;
1148
1148
  const overlayRect = this._overlayRect;
1149
1149
  const viewportRect = this._viewportRect;
@@ -1241,9 +1241,8 @@ class FlexibleConnectedPositionStrategy {
1241
1241
  this._originRect = this._getOriginRect();
1242
1242
  this._overlayRect = this._pane.getBoundingClientRect();
1243
1243
  this._viewportRect = this._getNarrowedViewportRect();
1244
- this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
1245
- const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition);
1246
- this._applyPosition(lastPosition, originPoint);
1244
+ this._containerRect = this._getContainerRect();
1245
+ this._applyPosition(lastPosition, this._getOriginPoint(this._originRect, this._containerRect, lastPosition));
1247
1246
  } else {
1248
1247
  this.apply();
1249
1248
  }
@@ -1766,6 +1765,18 @@ class FlexibleConnectedPositionStrategy {
1766
1765
  width
1767
1766
  };
1768
1767
  }
1768
+ _getContainerRect() {
1769
+ const isInlinePopover = this._overlayRef.getConfig().usePopover && this._popoverLocation !== 'global';
1770
+ const element = this._overlayContainer.getContainerElement();
1771
+ if (isInlinePopover) {
1772
+ element.style.display = 'block';
1773
+ }
1774
+ const dimensions = element.getBoundingClientRect();
1775
+ if (isInlinePopover) {
1776
+ element.style.display = '';
1777
+ }
1778
+ return dimensions;
1779
+ }
1769
1780
  }
1770
1781
  function extendStyles(destination, source) {
1771
1782
  for (let key in source) {
@@ -2071,11 +2082,12 @@ function createOverlayRef(injector, config) {
2071
2082
  host.classList.add('cdk-overlay-popover');
2072
2083
  }
2073
2084
  const customInsertionPoint = overlayConfig.usePopover ? overlayConfig.positionStrategy?.getPopoverInsertionPoint?.() : null;
2074
- overlayContainer.getContainerElement().appendChild(host);
2075
2085
  if (isElement(customInsertionPoint)) {
2076
2086
  customInsertionPoint.after(host);
2077
2087
  } else if (customInsertionPoint?.type === 'parent') {
2078
2088
  customInsertionPoint.element.appendChild(host);
2089
+ } else {
2090
+ overlayContainer.getContainerElement().appendChild(host);
2079
2091
  }
2080
2092
  return new OverlayRef(new DomPortalOutlet(pane, appRef, injector), host, pane, overlayConfig, injector.get(NgZone), injector.get(OverlayKeyboardDispatcher), doc, injector.get(Location), injector.get(OverlayOutsideClickDispatcher), config?.disableAnimations ?? injector.get(ANIMATION_MODULE_TYPE, null, {
2081
2093
  optional: true