@mozaic-ds/angular 2.1.2 → 2.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozaic-ds/angular",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=20.3.15",
@@ -8,6 +8,7 @@ import * as rxjs from 'rxjs';
8
8
  import { Observable } from 'rxjs';
9
9
  import { CdkPortalOutlet } from '@angular/cdk/portal';
10
10
  import * as _mozaic_ds_angular from '@mozaic-ds/angular';
11
+ import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
11
12
  import { ComponentHarness } from '@angular/cdk/testing';
12
13
 
13
14
  type MozBreadcrumbAppearance = 'standard' | 'inverse';
@@ -2316,7 +2317,8 @@ declare function isFlatOption<T>(item: FlatItem<T>): item is FlatOption<T>;
2316
2317
  declare class MozComboboxComponent<T = string> implements ControlValueAccessor {
2317
2318
  private readonly _doc;
2318
2319
  private readonly _overlay;
2319
- private readonly _cdr;
2320
+ /** Timestamp of the last viewport re-measure, to throttle onViewportScroll(). */
2321
+ private _lastViewportSync;
2320
2322
  /**
2321
2323
  * No-op scroll strategy: the dropdown embeds a CDK virtual-scroll viewport,
2322
2324
  * which is a global `CdkScrollable`. With the default `reposition` strategy,
@@ -2465,6 +2467,30 @@ declare class MozComboboxComponent<T = string> implements ControlValueAccessor {
2465
2467
  onSearchKeydown(event: KeyboardEvent): void;
2466
2468
  onOverlayOutsideClick(): void;
2467
2469
  onOverlayAttached(): void;
2470
+ /**
2471
+ * Zoneless fix for the virtual-scroll viewport.
2472
+ *
2473
+ * On Angular/CDK 22 in zoneless mode the viewport never recomputes its
2474
+ * rendered range while the user scrolls: `onContentScrolled` doesn't refresh
2475
+ * the window and the content transform stays frozen, so the panel "bounces"
2476
+ * and never reaches the bottom of the list. (CDK 21 used a different path and
2477
+ * was unaffected — hence Storybook on 21 looked fine while the 22 consumer
2478
+ * bounced.) Calling the viewport's public `checkViewportSize()` re-measures
2479
+ * and re-renders the correct window; it is idempotent at a valid scroll
2480
+ * position (verified — repeated calls don't move the scroll), so there is no
2481
+ * feedback loop. The handler receives the viewport through the `#viewport`
2482
+ * template reference, which resolves correctly even though the viewport lives
2483
+ * in the overlay portal (unlike `viewChild`).
2484
+ *
2485
+ * Throttled to ~one re-measure per frame (16 ms). Browsers already coalesce
2486
+ * scroll events to roughly one per animation frame — even for a high-frequency
2487
+ * trackpad / momentum scroll — but the throttle is a defensive cap so this
2488
+ * synchronous reflow can never be called in a tight burst. `checkViewportSize()`
2489
+ * is idempotent at a valid scroll offset (verified on the real CDK 22 zoneless
2490
+ * runtime — repeated calls don't move the scroll), so it never fights the
2491
+ * scroll position and there is no feedback loop.
2492
+ */
2493
+ onViewportScroll(viewport: CdkVirtualScrollViewport): void;
2468
2494
  /** Coerce the current value into an array (safe for .some/.filter/.every). */
2469
2495
  private _currentValueAsArray;
2470
2496
  writeValue(val: T | T[] | null): void;