Skip to content
Permalink
Browse files
fix(b-modal): solve body padding not being removed (#5771)
* update dom.js

* update

* update modal-manager.js
  • Loading branch information
Hiws committed Sep 14, 2020
1 parent 2a5a56e commit 78d51f1e7146cbed756853003a93b991c9f0d8bc
Showing 1 changed file with 4 additions and 4 deletions.
@@ -159,29 +159,29 @@ const ModalManager = /*#__PURE__*/ Vue.extend({
// Adjust fixed content padding
/* istanbul ignore next: difficult to test in JSDOM */
selectAll(Selector.FIXED_CONTENT).forEach(el => {
const actualPadding = getStyle(el, 'paddingRight')
const actualPadding = getStyle(el, 'paddingRight') || ''
setAttr(el, 'data-padding-right', actualPadding)
setStyle(el, 'paddingRight', `${toFloat(getCS(el).paddingRight, 0) + scrollbarWidth}px`)
body._paddingChangedForModal.push(el)
})
// Adjust sticky content margin
/* istanbul ignore next: difficult to test in JSDOM */
selectAll(Selector.STICKY_CONTENT).forEach(el => /* istanbul ignore next */ {
const actualMargin = getStyle(el, 'marginRight')
const actualMargin = getStyle(el, 'marginRight') || ''
setAttr(el, 'data-margin-right', actualMargin)
setStyle(el, 'marginRight', `${toFloat(getCS(el).marginRight, 0) - scrollbarWidth}px`)
body._marginChangedForModal.push(el)
})
// Adjust <b-navbar-toggler> margin
/* istanbul ignore next: difficult to test in JSDOM */
selectAll(Selector.NAVBAR_TOGGLER).forEach(el => /* istanbul ignore next */ {
const actualMargin = getStyle(el, 'marginRight')
const actualMargin = getStyle(el, 'marginRight') || ''
setAttr(el, 'data-margin-right', actualMargin)
setStyle(el, 'marginRight', `${toFloat(getCS(el).marginRight, 0) + scrollbarWidth}px`)
body._marginChangedForModal.push(el)
})
// Adjust body padding
const actualPadding = getStyle(body, 'paddingRight')
const actualPadding = getStyle(body, 'paddingRight') || ''
setAttr(body, 'data-padding-right', actualPadding)
setStyle(body, 'paddingRight', `${toFloat(getCS(body).paddingRight, 0) + scrollbarWidth}px`)
}

0 comments on commit 78d51f1

Please sign in to comment.