Skip to content

FF: Re-initializing select2 changes the style and width of select2 control #2078

@EleventyOne

Description

@EleventyOne

This is with Select2 3.4.5.

jsFiddle: http://jsfiddle.net/vx2mX/

Description:

In Chrome (32.0.1), if I reinitialize a select2 like so:

$("#select2").select2({       
    data : [{id:0,text:"red"},{id:1,text:"blue"},{id:2,text:"green"}],
    placeholder : "e.g., colourName"
});

This adds display:inline-block directly to the select2-container div's inline style, which matches what is defined for select2-container in its CSS. Accordingly, whatever layout it had previously, remains.

However, when I do the same on FF (26), it adds display:inline directly to the select2-container div's inline style, which appears to give it {width:100%} and forces it to drop down a line.

EDIT:

Tested with Select2 3.4.3 and the same behaviour occurs in FF. However, in Chrome, display:inline-block is not added directly to the select2-container div's inline style. The inline style remains empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions