3
I’m having a hard time fixing a bug that happens when using Select2 in a input-group
. The problem is that when selecting a option
with a very long name, the input-group
does not respect the width of the parent element.
<div class='elemento_pai' style='width:200px;'>
<div class="input-group">
<select class="select2">
<option></option>
<option>Nome extenso Nome extenso Nome extenso Nome extenso Nome extenso</option>
</select>
<span class="input-group-btn">
<button class="btn btn-sm btn-default" type="submit">
<span class="fa fa-user"></span>
</button>
</span>
</div>
</div>
What happens is that the input-group
ends up with a width
greater than 200px
, not respecting the elemento_pai
. Someone who’s been through it has found a solution?
Example of the problem in Jsfiddle
Unsolved issues:
I think the parent element is missing from your Fiddle example.
– Renato Dinhani
@Renatodin Icon in the Jsfiddle example does not need the element_pai, just decrease the size of your browser window and you will notice that select will not respect the width. That one
elemento_pai
was just to illustrate.– Paulo