bootstrap-select
bootstrap-select copied to clipboard
bootstrap 5.2.3 and bootstrap-select beta3 programmatically issue
In bootstrap 5 when you load programmatically an item (or a list of items) with $("#select1").selectpicker('refresh'); $("#select1").selectpicker('val', item); and you try again to reload it more times, the select shows the same object/item a lot of times, while the select should show item just one time because it's the same object. In the last bootstrap-select with bootstrap 4 works very well as I described, maybe it's a bug. I would like to say that another issue is when you use programmatically this code $("#select1").selectpicker('render'); in that case when you try to load an item, the select does nothing...
Thank you very much for the library: one of the best...
same issue.
Hello everybody, I have updated the library bootstrap-select(v1.14.0-beta3).js and a lot of problems have been fixed: at least in my case it works very well now. Of course I didn't adapt all library in its functions, but just some that for me didn't work: you can compare it with the original to detect the changes. In any case, finally, I can use it with bootstrap 5.3.0 without problems. Two raccomandations: when you use the instraction
- $('.selectpicker').selectpicker('val', item); the function, at the end, calls refresh and not render
- don't use render, to redrow the list of items, but refresh if you want to update the list... $('.selectpicker').selectpicker('refresh');
NOTE: I have used the separator ' | ' but you can change it with a comma
this is the link to the file, I hope it will be useful for you
https://gist.github.com/mattymatty76/c996d3b77f298b2ec133be59992df9d4
@mattymatty76
I haven't tested your modified version heavily yet but so far, it seems to solve serious issues in beta2 and beta3 I'm using it with boostrap 4.6 Thanks for your proposal.
@ZalemCitizen
It's a pleasure to know that it is useful for you thank you
@mattymatty76 did you have to do anything for the CSS? The provided CSS from this library doesn't work at all for me:
@mhenrixon have you tried to use the right css file? You could try with bootstrap css 5.2 or 5.3 and assure yourself that there aren't any other files in conflict with bootstap.css. In my case work at all
Have you tried to use the right css file?
This was me having to restart esbuild on every change. Will switch to Vite instead. Esbuild seem backward to me.