This commit is contained in:
KONE SOREL 2026-02-26 13:48:20 +00:00
parent 13fd9c73b7
commit 05203829af
3 changed files with 49 additions and 14 deletions

View File

@ -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;

View File

@ -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%'
});
}

View File

@ -45,7 +45,12 @@
</div>
<div class="col-md-4">
<label class="form-label small fw-bold text-muted required"><?= _("Type de Structure") ?></label>
<select class="selectpicker w-100" data-live-search="true" data-style="btn-form-select" id="codeTypeSociete" name="codeTypeSociete" required>
<select class="selectpicker w-100"
data-live-search="true"
data-style="btn-form-select"
id="codeTypeSociete"
name="codeTypeSociete"
required>
<?php liste_options($typeSociete, $this->nettoyer($societeuser['typeSociete'])); ?>
</select>
</div>
@ -71,14 +76,25 @@
<div class="row g-3">
<div class="col-md-6">
<label class="form-label small fw-bold text-muted required"><?= _("Pays de Résidence") ?></label>
<select onchange="liste_villes();" class="selectpicker w-100" data-live-search="true" data-style="btn-form-select" id="codePays" name="codePays" required>
<select onchange="liste_villes();"
class="selectpicker w-100"
data-live-search="true"
data-style="btn-form-select"
id="codePays"
name="codePays"
required>
<?php liste_options($pays, $this->nettoyer($societeuser['codePays'])); ?>
</select>
</div>
<div class="col-md-6">
<label class="form-label small fw-bold text-muted required"><?= _("Ville / Commune") ?></label>
<div id="div_ville">
<select class="selectpicker w-100" data-live-search="true" data-style="btn-form-select" id="ville" name="ville" required>
<select class="selectpicker w-100"
data-live-search="true"
data-style="btn-form-select"
id="ville"
name="ville"
required>
<?php liste_options($villes, $this->nettoyer($societeuser['ville'])); ?>
</select>
</div>