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

When data-size attribute is on, isDropup flag got wrong value #2766

Open
smiglu opened this issue Aug 2, 2022 · 2 comments
Open

When data-size attribute is on, isDropup flag got wrong value #2766

smiglu opened this issue Aug 2, 2022 · 2 comments
Labels

Comments

@smiglu
Copy link

smiglu commented Aug 2, 2022

When select has a lot of option (in my case 100+) I wanted to limit it to display only the 6 options with scroll. I use attribute data-size set to 6. But when i click to open select, isDropup flag is set to true, and option show above a select but is enough space to display options below button.

probably problem is in line:
estimate = liHeight * this.selectpicker.current.elements.length + menuPadding.vert;

proposition of fix that looks like it's working:
if (this.options.size !== 'auto') {
estimate = liHeight * this.options.size + menuPadding.vert;
} else {
estimate = liHeight * this.selectpicker.current.elements.length + menuPadding.vert;
}

bootstrap-select ver. 1.13.14

@smiglu smiglu added the bug label Aug 2, 2022
@NicolasCARPi
Copy link
Collaborator

Would you care to make a PR?

@smiglu
Copy link
Author

smiglu commented Aug 2, 2022

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants