From d5b22d34d062d6a409198bd521ab136ed4ce7c4b Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Fri, 23 Apr 2021 11:04:45 -0700 Subject: [PATCH] Safari mac: fix scrolling fix #1562 * changed to use document.scrollingElement as topmost element, which seem correct and required by safari. --- doc/CHANGES.md | 3 ++- src/utils.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/CHANGES.md b/doc/CHANGES.md index 6b033235b..ec7240ab7 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -57,7 +57,8 @@ Change log ## 4.2.1-dev -- fix [#1684](https://github.com/gridstack/gridstack.js/issues/1684) mac Safari H5 draggable broken in 4.0.1. Thanks [@wurambo](https://github.com/wurambo) +- fix [#1684](https://github.com/gridstack/gridstack.js/issues/1684) [#1550](https://github.com/gridstack/gridstack.js/issues/1550) mac Safari H5 draggable broken in 4.0.1. Thanks [@wurambo](https://github.com/wurambo) +- fix [#1562](https://github.com/gridstack/gridstack.js/issues/1562) mac Safari page scroll fix ## 4.2.1 (2021-4-18) diff --git a/src/utils.ts b/src/utils.ts index c617e9334..fbf569cbc 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -293,7 +293,7 @@ export class Utils { /** @internal */ static getScrollParent(el: HTMLElement): HTMLElement { - if (el === null) return document.documentElement; + if (el === null) return document.scrollingElement as HTMLElement; const style = getComputedStyle(el); const overflowRegex = /(auto|scroll)/;