()
| 30 | } |
| 31 | |
| 32 | export function conditionallyUpdateScrollbar() { |
| 33 | const scrollbarWidth = getScrollbarWidth(); |
| 34 | // https://github.com/twbs/bootstrap/blob/v4.0.0-alpha.6/js/src/modal.js#L433 |
| 35 | const fixedContent = document.querySelectorAll( |
| 36 | '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', |
| 37 | )[0]; |
| 38 | const bodyPadding = fixedContent |
| 39 | ? parseInt(fixedContent.style.paddingRight || 0, 10) |
| 40 | : 0; |
| 41 | |
| 42 | if (isBodyOverflowing()) { |
| 43 | setScrollbarWidth(bodyPadding + scrollbarWidth); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | let globalCssModule; |
| 48 |
no test coverage detected
searching dependent graphs…