From 7be96aad348d76d8506b72d936707fd49dcc1bec 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/vaadin-grid.html b/src/vaadin-grid.html index 5532552ec..0ba24b36b 100644 --- a/src/vaadin-grid.html +++ b/src/vaadin-grid.html @@ -774,6 +774,17 @@ 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.$.scroller.offsetHeight}px`; + this.$.table.style.minHeight = '100%'; + this.$.table.style.maxHeight = '100%'; + } + } } /**