bootstrap-select icon indicating copy to clipboard operation
bootstrap-select copied to clipboard

bootstrap 5.2.3 and bootstrap-select beta3 programmatically issue

Open mattymatty76 opened this issue 1 year ago • 8 comments

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...

mattymatty76 avatar May 21 '23 16:05 mattymatty76

same issue.

yangkun avatar Jun 04 '23 00:06 yangkun

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

  1. $('.selectpicker').selectpicker('val', item); the function, at the end, calls refresh and not render
  2. 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 avatar Jul 20 '23 19:07 mattymatty76

@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 avatar Sep 22 '23 16:09 ZalemCitizen

@ZalemCitizen

It's a pleasure to know that it is useful for you thank you

mattymatty76 avatar Sep 24 '23 07:09 mattymatty76

@mattymatty76 did you have to do anything for the CSS? The provided CSS from this library doesn't work at all for me:

CleanShot 2024-03-21 at 15 42 51@2x

mhenrixon avatar Mar 21 '24 14:03 mhenrixon

@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

mattymatty76 avatar Mar 25 '24 08:03 mattymatty76

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.

mhenrixon avatar Mar 25 '24 13:03 mhenrixon