mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-10 23:54:08 +02:00
modal: don't add margin & padding when sticky is not full width (#30621)
* modal: don't add margin & padding when sticky is not full width * Check if element is shorter than window Co-authored-by: XhmikosR <xhmikosr@gmail.com> Co-authored-by: Rohit Sharma <rohit2sharma95@gmail.com>
This commit is contained in:
@@ -466,6 +466,10 @@ class Modal extends BaseComponent {
|
||||
_setElementAttributes(selector, styleProp, callback) {
|
||||
SelectorEngine.find(selector)
|
||||
.forEach(element => {
|
||||
if (element !== document.body && window.innerWidth > element.clientWidth + this._scrollbarWidth) {
|
||||
return
|
||||
}
|
||||
|
||||
const actualValue = element.style[styleProp]
|
||||
const calculatedValue = window.getComputedStyle(element)[styleProp]
|
||||
Manipulator.setDataAttribute(element, styleProp, actualValue)
|
||||
|
Reference in New Issue
Block a user