Skip to content

Issues with responsive width #3278

@fredmalone

Description

@fredmalone

Unless I am missing something (I apologize if I have), select2 is not fully responsive. Look at this code:

    <div class="col-sm-6">
        <div class="form-group">
            <label>Submit to</label>
            <select class="form-control" id="SubmitQueue" name="SubmitQueue">
                <option value="1">Subsequent Civil</option>
                <option value="2">Subsequent Criminal</option>
                <option value="3">Judge Order - Civil</option>
                <option value="4">Review Sign</option>
                <option value="5">Subsequent Domestic Family</option>
                <option value="6">Judge Order - Criminal</option>
            </select>
        </div>
    </div>

The original select has 100% width from the form-control class. Select2 is creating a fixed width container. Thus, when I resize the window the select2 container does not resize as it should since the col-sm-6 class is a percentage.

So did I miss something in my initialization or is this an issue?

EDIT: OK. I looked throught the code and I noticed that the _resolveWidth doesn't even attempt to get a percentage width from CSS and only works with an inline style. I can live with that. How did it work in 3.5.2 without the inline style?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions