* 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
()
| 845 | * of these events. |
| 846 | */ |
| 847 | updateStickyHeaderRowStyles(): void { |
| 848 | const headerRows = this._getRenderedRows(this._headerRowOutlet); |
| 849 | |
| 850 | // Hide the thead element if there are no header rows. This is necessary to satisfy |
| 851 | // overzealous a11y checkers that fail because the `rowgroup` element does not contain |
| 852 | // required child `row`. |
| 853 | if (this._isNativeHtmlTable) { |
| 854 | const thead = closestTableSection(this._headerRowOutlet, 'thead'); |
| 855 | if (thead) { |
| 856 | thead.style.display = headerRows.length ? '' : 'none'; |
| 857 | } |
| 858 | } |
| 859 | |
| 860 | const stickyStates = this._headerRowDefs.map(def => def.sticky); |
| 861 | this._stickyStyler.clearStickyPositioning(headerRows, ['top']); |
| 862 | this._stickyStyler.stickRows(headerRows, stickyStates, 'top'); |
| 863 | |
| 864 | // Reset the dirty state of the sticky input change since it has been used. |
| 865 | this._headerRowDefs.forEach(def => def.resetStickyChanged()); |
| 866 | } |
| 867 | |
| 868 | /** |
| 869 | * Updates the footer sticky styles. First resets all applied styles with respect to the cells |
no test coverage detected