From 18dafdbde3e638b02811374a39ce040ec39beb87 Mon Sep 17 00:00:00 2001 From: Tom Fleming Date: Wed, 14 Oct 2020 14:30:53 -0400 Subject: [PATCH 1/2] Fixed scroll issues noticed on iPads - DP-20201 --- .../source/assets/js/modules/mainNavHamburger.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/patternlab/styleguide/source/assets/js/modules/mainNavHamburger.js b/patternlab/styleguide/source/assets/js/modules/mainNavHamburger.js index 8c7719438f..3df5419139 100644 --- a/patternlab/styleguide/source/assets/js/modules/mainNavHamburger.js +++ b/patternlab/styleguide/source/assets/js/modules/mainNavHamburger.js @@ -462,16 +462,10 @@ function closeMenu() { } if (body.style.position === "fixed") { - body.style.position = "relative"; + // At the same time, the alert needs to be scrolled up to the position again to retain the page elements position. + window.scrollTo(0, alertlOffsetPosition); + body.removeAttribute("style"); } - // When the page is loaded first time, body initially has "top: 0;". - // As the menu closes, reset the override top value to 0. - // Note: The top value is recognized as a string, not number. - if (body.style.top.indexOf("-") !== -1) { - body.style.top = 0; - } - // At the same time, the alert needs to be scrolled up to the position again to retain the page elements position. - window.scrollTo(0, alertlOffsetPosition); } function commonCloseMenuTasks() { From c0c3bb11a8535ddd0cdfc106830f3d427dfffd64 Mon Sep 17 00:00:00 2001 From: Tom Fleming Date: Wed, 14 Oct 2020 14:45:03 -0400 Subject: [PATCH 2/2] Added changelog - DP-20201 --- changelogs/DP-20201.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 changelogs/DP-20201.yml diff --git a/changelogs/DP-20201.yml b/changelogs/DP-20201.yml new file mode 100644 index 0000000000..84d2567f2c --- /dev/null +++ b/changelogs/DP-20201.yml @@ -0,0 +1,11 @@ +Fixed: + - project: Patternlab + component: Header + description: Move window scrollTo and remove inline body styling when closing the global nav menu. (#1210) + issue: DP-20201 + impact: Patch + - project: Patternlab + component: Header + description: Move window scrollTo and remove inline body styling when closing the global nav menu. (#1210) + issue: DP-20209 + impact: Patch