Problems with a Select using a chosen and a collapsed button in Bootstrap

1

Hello, I am wanting to implement an advanced search form in which it opens up from a collapsed button in bootstrap. Here I implement a panel with a select.

I implement a plugin called Chosen that improves aesthetics to select and others. the is that this happens to me

<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Busqueda Avanzada
</button>
<div class="collapse" id="collapseExample">
 <div class="panel panel-default" style="margin-top:2px">
  <div class="panel-body">
    <div class="form-group">
            {!! Form::label('provincia_id','Provincia') !!}
            {!! Form::select('provincia_id',$provincias,null,['class'=>'form-control select-provincia','placeholder'=>'Provincia del evento...','required']) !!}
    </div>

  </div>
 </div>
</div>
@section('js')
<script>

    $('.select-provincia').chosen({
        placeholder_text:'Seleccione una Categoria',
    });

</script>   
@endsection

If I deactivate the plugin, it looks good (like a normal select), activated but outside the collapsed it also works fine.

Any ideas where the problem may be?

    
asked by Cidius 10.10.2016 в 01:24
source

1 answer

0

The answer was quite simple but not as logical as I expected. Somehow you have a problem with size the collapsed

On trial and error, looking for something among the chosen parameters, I found that you can modify the size. Probe and effectively grows in percentage like any CSS.

$('.select-provincia').chosen({
    width: "100%"
});

By putting 100% it fits the size of the container

    
answered by 10.10.2016 / 05:45
source