@angular/cdk 19.1.3 → 19.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.
@@ -728,20 +728,12 @@ class StickyStyler {
728
728
  * @param replay Whether to enqueue this call for replay after a ResizeObserver update.
729
729
  */
730
730
  updateStickyColumns(rows, stickyStartStates, stickyEndStates, recalculateCellWidths = true, replay = true) {
731
- if (replay) {
732
- this._updateStickyColumnReplayQueue({
733
- rows: [...rows],
734
- stickyStartStates: [...stickyStartStates],
735
- stickyEndStates: [...stickyEndStates],
736
- });
737
- }
731
+ // Don't cache any state if none of the columns are sticky.
738
732
  if (!rows.length ||
739
733
  !this._isBrowser ||
740
734
  !(stickyStartStates.some(state => state) || stickyEndStates.some(state => state))) {
741
- if (this._positionListener) {
742
- this._positionListener.stickyColumnsUpdated({ sizes: [] });
743
- this._positionListener.stickyEndColumnsUpdated({ sizes: [] });
744
- }
735
+ this._positionListener?.stickyColumnsUpdated({ sizes: [] });
736
+ this._positionListener?.stickyEndColumnsUpdated({ sizes: [] });
745
737
  return;
746
738
  }
747
739
  // Coalesce with sticky row updates (and potentially other changes like column resize).
@@ -755,6 +747,13 @@ class StickyStyler {
755
747
  let cellWidths;
756
748
  let startPositions;
757
749
  let endPositions;
750
+ if (replay) {
751
+ this._updateStickyColumnReplayQueue({
752
+ rows: [...rows],
753
+ stickyStartStates: [...stickyStartStates],
754
+ stickyEndStates: [...stickyEndStates],
755
+ });
756
+ }
758
757
  this._afterNextRender({
759
758
  earlyRead: () => {
760
759
  cellWidths = this._getCellWidths(firstRow, recalculateCellWidths);
@@ -895,6 +894,7 @@ class StickyStyler {
895
894
  if (this._stickyColumnsReplayTimeout) {
896
895
  clearTimeout(this._stickyColumnsReplayTimeout);
897
896
  }
897
+ this._resizeObserver?.disconnect();
898
898
  this._destroyed = true;
899
899
  }
900
900
  /**
@@ -1040,10 +1040,9 @@ class StickyStyler {
1040
1040
  _updateStickyColumnReplayQueue(params) {
1041
1041
  this._removeFromStickyColumnReplayQueue(params.rows);
1042
1042
  // No need to replay if a flush is pending.
1043
- if (this._stickyColumnsReplayTimeout) {
1044
- return;
1043
+ if (!this._stickyColumnsReplayTimeout) {
1044
+ this._updatedStickyColumnsParamsToReplay.push(params);
1045
1045
  }
1046
- this._updatedStickyColumnsParamsToReplay.push(params);
1047
1046
  }
1048
1047
  /** Remove updates for the specified rows from the queue. */
1049
1048
  _removeFromStickyColumnReplayQueue(rows) {