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

menu size doesn't update when virtualScroll is disabled while the menu is open #2258

Closed
alvaro-marting opened this issue Apr 10, 2019 · 2 comments

Comments

@alvaro-marting
Copy link

Hello, I have found that when handling a big workload (525+ items in the select, when we have optgroups and accounting for them, and 599+ without optgroups)the size of the select does not refresh properly.
This happens only when the selector has been opened prior to filtering or disabling the items we dont want to see.

This has been tested both in Firefox and Chrome latest versions.

  1. Open the jsFiddle: http://jsfiddle.net/amarting/L8ny9qp6/41/
  2. Open all selectors before 10 seconds pass (There is a setTimeout with a dummy function that disables every optgroup and options with the disabled class apart from 2 that have the class notDisabled)
  3. Watch as the one in the left has an appropiate size and the other 2 allow scrolling through an empty list. This is because the margin-bottom stays the same as if there has been no change in the list of items.

I only glimpsed the source code of the library, so this is a wild wild guess that almost surely is wrong, but maybe getComputedStyle or jquery.css are called before the task of rendering the items is finished? Maybe a callback is needed with a big workload?

P.D: My workaround about this consisted of destroying and recreating the selectpicker, as the problem lies when refreshing, even though I don't think that would be ideal.

Thank you for this awesome library! Keep up the good work.

@caseyjhol caseyjhol changed the title Selector does not resize properly with HideDisabled:true with a large number of items menu size doesn't update when virtualScroll is disabled while the menu is open Apr 10, 2019
@caseyjhol
Copy link
Member

What's happening: the menu has a large number of options, auto-enabling virtualScroll. Most of the options are then hidden after a timeout, disabling virtualScroll, but the "spacer" margin on the menu isn't reset.

@caseyjhol
Copy link
Member

Released in v1.13.10!

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

No branches or pull requests

2 participants