Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dropdown position when use data-size attribute #2767

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion js/bootstrap-select.js
Expand Up @@ -2250,7 +2250,11 @@
// This is useful for smaller menus, where there might be plenty of room
// below the button without setting dropup, but we can't know
// the exact height of the menu until createView is called later
estimate = liHeight * this.selectpicker.current.data.length + menuPadding.vert;
if (this.options.size !== 'auto') {
smiglu marked this conversation as resolved.
Show resolved Hide resolved
estimate = liHeight * this.options.size + menuPadding.vert;
} else {
estimate = liHeight * this.selectpicker.current.data.length + menuPadding.vert;
}

isDropup = this.sizeInfo.selectOffsetTop - this.sizeInfo.selectOffsetBot > this.sizeInfo.menuExtras.vert && estimate + this.sizeInfo.menuExtras.vert + 50 > this.sizeInfo.selectOffsetBot;

Expand Down