MCPcopy Create free account
hub / github.com/angular/components / _checkStickyStates

Method _checkStickyStates

src/cdk/table/table.ts:1460–1484  ·  view source on GitHub ↗

* Checks if there has been a change in sticky states since last check and applies the correct * sticky styles. Since checking resets the "dirty" state, this should only be performed once * during a change detection and after the inputs are settled (after content check).

()

Source from the content-addressed store, hash-verified

1458 * during a change detection and after the inputs are settled (after content check).
1459 */
1460 private _checkStickyStates() {
1461 const stickyCheckReducer = (
1462 acc: boolean,
1463 d: CdkHeaderRowDef | CdkFooterRowDef | CdkColumnDef,
1464 ) => {
1465 return acc || d.hasStickyChanged();
1466 };
1467
1468 // Note that the check needs to occur for every definition since it notifies the definition
1469 // that it can reset its dirty state. Using another operator like `some` may short-circuit
1470 // remaining definitions and leave them in an unchecked state.
1471
1472 if (this._headerRowDefs.reduce(stickyCheckReducer, false)) {
1473 this.updateStickyHeaderRowStyles();
1474 }
1475
1476 if (this._footerRowDefs.reduce(stickyCheckReducer, false)) {
1477 this.updateStickyFooterRowStyles();
1478 }
1479
1480 if (Array.from(this._columnDefsByName.values()).reduce(stickyCheckReducer, false)) {
1481 this._stickyColumnStylesNeedReset = true;
1482 this.updateStickyColumnStyles();
1483 }
1484 }
1485
1486 /**
1487 * Creates the sticky styler that will be used for sticky rows and columns. Listens

Callers 1

_renderMethod · 0.95

Tested by

no test coverage detected