-
-
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
Bootstrap select dropdown items not synchronized with underlying native select options after dynamic add/remove and refresh from code #2724
Comments
Hi, Replaced your inline css and js with cdn hosted libraries, and then your code works: |
Hello and thank you for the interest. So there was a regression between version 1.14.0-beta2 and commit 04cc1fd? |
Hi mate, No idea sorry. Im just looking into weather we use this beta on our new site and was concerned about this bug, as it is a well used use case on our site. |
I think our team has run into this bug as well. Sometimes (I wasn't able to isolate the conditions when this happens), calling Workarounds that seem to work for me:
|
I am also using the workaround of calling |
I can confirm the issue is present in latest dev-tag. Using:
@kennysong 's workaround of Thanks, |
This workaround doesn't work for me using the same bootstrap-select, bootstrap and jQuery versions. |
jayb611 commented good solution #2712 (comment) |
One caveat is that events hooked into the select are lost with |
any update on this bug fix, it seems quite a basic requirement to change the options dynamically (remove/add without duplication) |
EDIT: my issue is a duplicate of #2445 I am having similar issue - when dynamically replacing all options && preselecting one option in the new list
The issue isn't present in 1.13.12 Could be related to this issue because it's also problem with "refresh". |
When bootstrap select is initialized with a select without options, and the options are added and removed programmatically from the code, with the refresh method called to update the select, the elements of the dropdown created by bootstrap select are not synchronized with those of the select.
In the example I attached, the select is initially empty.
Clicking on the "load" button should remove all select options and replaces them with new ones. In this case, bootstrap select will append them instead of replacing them (as in native select).
Clicking the "empty" button should remove all options. Here, bootstrap select will continue to display the previous ones, although all the options of the native select element have been removed.
Version used
Minimal, Reproducible Example
https://jsfiddle.net/234vackd/2
The text was updated successfully, but these errors were encountered: