From 24b7f91c08da7b81991fe940535ebd5641852a80 Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sat, 30 Mar 2019 23:42:56 -0300 Subject: [PATCH 1/3] fix(modal): prevent page scroll as modal opens --- src/components/modal/modal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/modal/modal.js b/src/components/modal/modal.js index 27e626ae5f3..20e7724e0aa 100644 --- a/src/components/modal/modal.js +++ b/src/components/modal/modal.js @@ -522,7 +522,7 @@ export default { this.setScrollbar() } this.adjustDialog() - this.setModalOpenClass(true) + // this.setModalOpenClass(true) this.setResizeEvent(true) }, onEnter() { @@ -787,6 +787,7 @@ export default { setAttr(body, 'data-padding-right', actualPadding) body.style.paddingRight = `${parseFloat(calculatedPadding) + scrollbarWidth}px` } + this.setModalOpenClass(true) }, resetScrollbar() { const body = document.body From 3df9e84f6f718d3d01449000f36328fe8aba58fa Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sun, 31 Mar 2019 00:03:45 -0300 Subject: [PATCH 2/3] Update modal.js --- src/components/modal/modal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/modal/modal.js b/src/components/modal/modal.js index 20e7724e0aa..7e068d9b080 100644 --- a/src/components/modal/modal.js +++ b/src/components/modal/modal.js @@ -520,6 +520,7 @@ export default { const count = incrementModalOpenCount() if (count === 1) { this.setScrollbar() + this.setModalOpenClass(true) } this.adjustDialog() // this.setModalOpenClass(true) @@ -787,7 +788,7 @@ export default { setAttr(body, 'data-padding-right', actualPadding) body.style.paddingRight = `${parseFloat(calculatedPadding) + scrollbarWidth}px` } - this.setModalOpenClass(true) + // this.setModalOpenClass(true) }, resetScrollbar() { const body = document.body From 77757c43b736ab21f0461877fbfe0467843b96aa Mon Sep 17 00:00:00 2001 From: Troy Morehouse Date: Sun, 31 Mar 2019 00:13:53 -0300 Subject: [PATCH 3/3] Update modal.js --- src/components/modal/modal.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/modal/modal.js b/src/components/modal/modal.js index 7e068d9b080..a36f63e15a7 100644 --- a/src/components/modal/modal.js +++ b/src/components/modal/modal.js @@ -523,7 +523,6 @@ export default { this.setModalOpenClass(true) } this.adjustDialog() - // this.setModalOpenClass(true) this.setResizeEvent(true) }, onEnter() { @@ -788,7 +787,6 @@ export default { setAttr(body, 'data-padding-right', actualPadding) body.style.paddingRight = `${parseFloat(calculatedPadding) + scrollbarWidth}px` } - // this.setModalOpenClass(true) }, resetScrollbar() { const body = document.body