Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap select doesn't update selected options properly

I am using bootstrap select plugin, When the options at bottom of the select is selected the bootstrap select does not refresh the select properly(the previously selected options remains as selected as the boostrap select does not remove the selected class properly), Do I have to listen the change event on bootstrap select and refresh the options, This is not occurring while having lesser options, What mightbe the solution for this

  $('.selectpicker').selectpicker({
  });

Js fiddle :

https://jsfiddle.net/aarthi_101/79rz3j1w/18/,

I have posted an issue at github, https://github.com/snapappointments/bootstrap-select/issues/85

This is the result I am getting

like image 671
Aarthi Avatar asked Nov 22 '25 21:11

Aarthi


1 Answers

Just refresh when change the select and it'll work well. The code :

$('select').on('change',function(){

   $(this).selectpicker('refresh');
});
like image 177
Norhan Avatar answered Nov 25 '25 09:11

Norhan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!