set the width of select2 input (through Angular-ui directive)

前端 未结 12 1812
名媛妹妹
名媛妹妹 2020-12-22 20:14

I have problem making this plunkr (select2 + angulat-ui) work.

http://plnkr.co/edit/NkdWUO?p=preview

In local setup, I get the select2 work, but I cannot set

12条回答
  •  忘掉有多难
    2020-12-22 21:11

    Add width resolve option to your select2 function

    $(document).ready(function() { 
            $("#myselect").select2({ width: 'resolve' });           
    });
    

    After add below CSS to your stylesheet

    .select2-container {
    width: 100% !important;
    }
    

    It will sort the issue

提交回复
热议问题