This commit is contained in:
2021-08-29 22:04:03 +03:00
parent df99e877e3
commit 7c153a2e6d
7 changed files with 46 additions and 12 deletions
+2
View File
@@ -1191,6 +1191,7 @@ kit.PluginManager.register('bsCore', function(module, exports, require, global){
this._disableOverFlow()
// give padding to element to balance the hidden scrollbar width
this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width)
this._element.style.setProperty('--scroll-bar-size', `${width}px`);
// trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth
this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width)
this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width)
@@ -1221,6 +1222,7 @@ kit.PluginManager.register('bsCore', function(module, exports, require, global){
this._resetElementAttributes(this._element, 'paddingRight')
this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight')
this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight')
this._element.style.setProperty('--scroll-bar-size', '0');
}
_saveInitialAttribute(element, styleProp) {