-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
"Deselect All" doesn't consistently work with virtual scroll #2352
Comments
Bug reports must include a live demo of the problem. Per our contributing guidelines, please create a reduced test case (you can use our preconfigured Plunker), and report back with your link. |
Here you go: |
This appears to have been fixed in v1.13.13. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Chrome (mac), 78.0.3904.87
jQuery 3.3.1
bootstrap 3.4.1
bootstrap-select 1.13.12
angularjs 1.7.8
First of all, thanks for providing and maintaining a great plugin. It provides a lot of nice functionality for us.
Here's an edge case I encountered.
I have a selectpicker with a lot of options (~2000) and virtual scroll enabled. And the options are dynamically updated based on the value of a second selectpicker.
I can reproduce the issue with the following:
If there are any selected options within the current updated view, "Deselect All" works as expected. If a new option is selected, "Deselect All" works as expected. If I search for the selected options and bring them into the view, "Deselect All" works as expected. It's only when the options are outside the current view, the options are updated and the selectpicker refreshed, that the "Deselect All" step fails.
I can fix the issue with a small change to the "changeAll" method. In the case above, the "previousSelected" count is unexpectantly zero. However, the "prevValue" array is correct and represents the correct selections from step #1 above.
If I change line 2715 from:
to
"Deselect All" works as expected.
Looking more closely at the "previousSelected" count, it seems that it's not correct when some of the previously selected options are in the current view and some are not.
The text was updated successfully, but these errors were encountered: