From 13bb7d2ac099120631f229a7fca92a51324f2231 Mon Sep 17 00:00:00 2001 From: Tomi Virkki Date: Tue, 22 Sep 2020 18:58:35 +0300 Subject: [PATCH] Workaround for the disappearing header issue on old iOS versions --- src/vaadin-grid.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/vaadin-grid.html b/src/vaadin-grid.html index 5532552ec..08bca77ea 100644 --- a/src/vaadin-grid.html +++ b/src/vaadin-grid.html @@ -774,6 +774,18 @@ this.$.items.style.paddingBottom = `${this.$.footer.offsetHeight}px`; } } + + if (this._ios) { + const isOldIOS = !window.CSS.supports('position', 'sticky'); + if (isOldIOS) { + // Due to a rendering bug, the sticky header may disappear on an older iOS (10-12) Safari + // if the grid is used inside of a flex box. This is a workaround for the issue. + this.$.table.style.height = ''; + this.$.table.style.height = `${this.$.scroller.offsetHeight}px`; + this.$.table.style.minHeight = '100%'; + this.$.table.style.maxHeight = '100%'; + } + } } /**