You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Search for and select options that are outside the current view.
Update the options via the second selectpicker, but where the current selections are still valid.
Clicking on the "Deselect All" button does not deselect the options.
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:
if (previousSelected === currentSelected) return;
to
if (prevValue.length === currentSelected) return;
"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:
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.
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: