検証時の環境
- bootstrap 4.1.3
- jQuery 3.3.1
- Chrome 79.0
背景
画面ロード時に,状態に応じてbootstrap-selectの表示/非表示を切り替えたく,
$('#select').show();
のようにしていましたが,反映されたりされなかったりでした.
結果
以下にたどり着きました.
https://stackoverflow.com/questions/44511501/how-do-i-hide-a-bootstrap-select
「bootstrap-selectは内部的に複数のbuttonに変換されるので親要素に対して適用すべし」とのことなので,適用しました.
いまのところうまくいっている様子です.