Repository navigation
Conversation
|
When use this code found maybe bug in Popper.js(( Cannot set offset.left more when element width but can set any negative values. Maybe it's logic of Popper PS |
|
I think what better send all popper params, because it's more customizable solution and can change more settings of Popper _getOffset(data) {
const popperOffset = $.extend({}, data.offsets, this._config.offsetFn(data.offsets) || {})
Object.keys(popperOffset).forEach((key) => {
data.offsets[key] = popperOffset[key]
})
return data
}With this code and this bind const dropdownMegaToggle = $('.dropdown-toggle--mega');
dropdownMegaToggle.dropdown({
offsetFn: function(data) {
let popper = data.popper;
let reference = data.reference;
let w = $(window).width();
let buttonOffset = dropdownMegaToggle.offset();
popper.top = 100;
reference.width = w / 2; // f*cking Popper.js crutch
popper.left = w / 2 - popper.width / 2 - buttonOffset.left;
return data
}
}); |
There was a problem hiding this comment.
Please do not commit dist files, you must revert this change
There was a problem hiding this comment.
No need for an new option here, just check if offset is a function or not
There was a problem hiding this comment.
you have unrelated changes here and their...
|
Why did you closed your PR @romanlex ? |
|
@Johann-S big thx for your reply and thx for what you teach and say how to properly make changes. |
|
Ok 😃 you're welcome 😉 but you can just update this one |
|
I don't now ) How I can close this PR? |

Sorry for bad English.
Add support for calculate and dynamically change offset position for dropdown menu.
Function call always when call Popper.js modifierFn.
Now I can change dynamically position of dropdown menu