MCPcopy Index your code
hub / github.com/angular/components / updateStickyHeaderRowStyles

Method updateStickyHeaderRowStyles

src/cdk/table/table.ts:829–848  ·  view source on GitHub ↗

* Updates the header sticky styles. First resets all applied styles with respect to the cells * sticking to the top. Then, evaluating which cells need to be stuck to the top. This is * automatically called when the header row changes its displayed set of columns, or if its * sticky input ch

()

Source from the content-addressed store, hash-verified

827 * of these events.
828 */
829 updateStickyHeaderRowStyles(): void {
830 const headerRows = this._getRenderedRows(this._headerRowOutlet);
831
832 // Hide the thead element if there are no header rows. This is necessary to satisfy
833 // overzealous a11y checkers that fail because the `rowgroup` element does not contain
834 // required child `row`.
835 if (this._isNativeHtmlTable) {
836 const thead = closestTableSection(this._headerRowOutlet, 'thead');
837 if (thead) {
838 thead.style.display = headerRows.length ? '' : 'none';
839 }
840 }
841
842 const stickyStates = this._headerRowDefs.map(def => def.sticky);
843 this._stickyStyler.clearStickyPositioning(headerRows, ['top']);
844 this._stickyStyler.stickRows(headerRows, stickyStates, 'top');
845
846 // Reset the dirty state of the sticky input change since it has been used.
847 this._headerRowDefs.forEach(def => def.resetStickyChanged());
848 }
849
850 /**
851 * Updates the footer sticky styles. First resets all applied styles with respect to the cells

Callers 2

_checkStickyStatesMethod · 0.95

Calls 5

_getRenderedRowsMethod · 0.95
closestTableSectionFunction · 0.85
stickRowsMethod · 0.80
resetStickyChangedMethod · 0.65

Tested by

no test coverage detected