mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-07 22:26:57 +02:00
Add Tests on scrollbar.js & better handling if a style property doesn't exists (#33948)
* scrollbar.js: add some tests transfer test from modal.spec. to scrollbar.spec proper handling if style property doesn't exist
This commit is contained in:
@@ -44,8 +44,11 @@ const _setElementAttributes = (selector, styleProp, callback) => {
|
||||
}
|
||||
|
||||
const actualValue = element.style[styleProp]
|
||||
if (actualValue) {
|
||||
Manipulator.setDataAttribute(element, styleProp, actualValue)
|
||||
}
|
||||
|
||||
const calculatedValue = window.getComputedStyle(element)[styleProp]
|
||||
Manipulator.setDataAttribute(element, styleProp, actualValue)
|
||||
element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user