The fix would be to take the parent's height into account as well when button.offsetTop is used to position the element as we start from bottom to position instead of top in inlcudes.js:
var popupSetDimensions = function popupSetDimensions(button, popup) {
var px = button.offsetTop - 1,
// position next to the button we clicked
windowHeight = window.innerHeight,
- maxHeight = windowHeight - px - 40; // make sure the popup doesn't extend below the fold
+ maxHeight = windowHeight - px - 40, // make sure the popup doesn't extend below the fold
+ pxVertical = options.renderVerticalPosition === 'bottom' ? button.offsetParent.clientHeight - 21 - px : px;
- popup.style[options.renderVerticalPosition] = "".concat(px, "px");
+ popup.style[options.renderVerticalPosition] = "".concat(pxVertical, "px");
popup.style.maxHeight = "".concat(maxHeight, "px");
popup.style[options.renderHorizontalPosition] = "".concat(
button.offsetWidth - 3,
"px"
); // move left or right, based on config
};
then would get this, which mimics the behaviour of top by aligning to the bottom of the button:
if you choose
data-vertical-position
withbottom
property the popup is not positioned correctly.If you set these properties you get this:
The fix would be to take the parent's height into account as well when
button.offsetTop
is used to position the element as we start frombottom
to position instead oftop
ininlcudes.js
:then would get this, which mimics the behaviour of
top
by aligning to the bottom of the button: