* 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
()
| 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 |
no test coverage detected