diff options
Diffstat (limited to 'core/misc/tableheader.es6.js')
-rw-r--r-- | core/misc/tableheader.es6.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/misc/tableheader.es6.js b/core/misc/tableheader.es6.js index 2debc838a3b7..f7fc2f200e92 100644 --- a/core/misc/tableheader.es6.js +++ b/core/misc/tableheader.es6.js @@ -208,6 +208,8 @@ * Create the duplicate header. */ createSticky() { + // For caching purposes. + this.$html = $('html'); // Clone the table header so it inherits original jQuery properties. const $stickyHeader = this.$originalHeader.clone(true); // Hide the table to avoid a flash of the header clone upon page load. @@ -245,6 +247,11 @@ if (typeof offsetLeft === 'number') { css.left = `${this.tableOffset.left - offsetLeft}px`; } + this.$html.css( + 'scroll-padding-top', + displace.offsets.top + + (this.stickyVisible ? this.$stickyTable.height() : 0), + ); return this.$stickyTable.css(css); }, |