UNPKG

@material-ui/core

Version:

React components that implement Google's Material Design.

24 lines (21 loc) 781 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; // A change of the browser zoom change the scrollbar size. // Credit https://github.com/twbs/bootstrap/blob/3ffe3a5d82f6f561b82ff78d82b32a7d14aed558/js/src/modal.js#L512-L519 function getScrollbarSize() { var scrollDiv = document.createElement('div'); scrollDiv.style.width = '99px'; scrollDiv.style.height = '99px'; scrollDiv.style.position = 'absolute'; scrollDiv.style.top = '-9999px'; scrollDiv.style.overflow = 'scroll'; document.body.appendChild(scrollDiv); var scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); return scrollbarSize; } var _default = getScrollbarSize; exports.default = _default;