diff --git a/Bootstrap_new/css/theme-modern.css b/Bootstrap_new/css/theme-modern.css index 851445b2..b84e0c39 100644 --- a/Bootstrap_new/css/theme-modern.css +++ b/Bootstrap_new/css/theme-modern.css @@ -1229,6 +1229,20 @@ h6 a:hover { .bg-primary-ghost { background: rgba(33, 46, 83, 0.05); } /* --- FIX SELECTPICKER GLOBAL --- */ + +/* Cache l'élément select original que le plugin est censé remplacer */ +select.selectpicker { + display: none !important; +} + +/* Si Bootstrap-Select crée une copie invisible mais qui prend de la place */ +.bootstrap-select > select.selectpicker { + display: none !important; + visibility: hidden !important; + position: absolute !important; + z-index: -100 !important; +} + .btn-form-select { background-color: #fff !important; border: 1px solid #e2e8f0 !important; diff --git a/Js/fonctions.js b/Js/fonctions.js index faa728a1..fae90d0e 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -46023,18 +46023,23 @@ $(function(){ // Initialiser Select2 $('.js-example-basic-single').select2(); - // Initialiser Bootstrap Select avec vérification + // On vérifie si Bootstrap Select est chargé if (typeof $.fn.selectpicker !== 'undefined') { - $('.selectpicker').selectpicker(); - } else { - console.warn("Bootstrap Select n'est pas disponible. Assurez-vous que bootstrap-select.min.js est chargé."); - // Fallback: transformer les select en select2 - $('.selectpicker').each(function() { - if (!$(this).hasClass('select2-hidden-accessible')) { - $(this).select2({ - theme: 'bootstrap-5' - }); - } + // Optionnel : On détruit d'éventuelles instances précédentes pour éviter les doublons + $('.selectpicker').selectpicker('destroy'); + + // On initialise avec les paramètres de style + $('.selectpicker').selectpicker({ + style: 'btn-form-select', + noneSelectedText: 'Aucune sélection' + }); + } + // Si Bootstrap Select manque, on utilise Select2 uniquement en dernier recours + else if (typeof $.fn.select2 !== 'undefined') { + console.warn("Bootstrap Select manquant, repli sur Select2."); + $('.selectpicker').select2({ + theme: 'bootstrap-5', + width: '100%' }); } diff --git a/Vue/Modifierparametresgeneraux/index.php b/Vue/Modifierparametresgeneraux/index.php index 9dd11358..eb83c053 100755 --- a/Vue/Modifierparametresgeneraux/index.php +++ b/Vue/Modifierparametresgeneraux/index.php @@ -45,7 +45,12 @@