Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/440.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 从下拉列表中选择2个小于的容器_Javascript_Css_Angularjs_Angular Ui_Angularjs Select2 - Fatal编程技术网

Javascript 从下拉列表中选择2个小于的容器

Javascript 从下拉列表中选择2个小于的容器,javascript,css,angularjs,angular-ui,angularjs-select2,Javascript,Css,Angularjs,Angular Ui,Angularjs Select2,我已经在我的应用程序中实现了angular ui select2,它工作正常,但是选择框容器(搜索上方)的呈现比下拉面板小 我的意思是: HMTL: <select ui-select2="{placeholder:'Select a User', dropdownAutoWidth: true}" class="animated slideInDown" id="entityDropDown" ng-model="selectedUser"

我已经在我的应用程序中实现了angular ui select2,它工作正常,但是选择框容器(搜索上方)的呈现比下拉面板小

我的意思是:

HMTL:

<select 
    ui-select2="{placeholder:'Select a User', dropdownAutoWidth: true}"
    class="animated slideInDown" 
    id="entityDropDown" 
    ng-model="selectedUser" 
    ng-options="user as user.name for user in users" 
    ng-change="getUserInfo(selectedUser)"> <option>Place Holder</option>
</select>
占位符

添加到您的ctor参数
宽度

<select
  ui-select2="{placeholder:'Select a User', dropdownAutoWidth: true, width: '100%'} >
</select>

是否希望下拉列表不滚动且列表完全可见?搜索上方的区域与下拉列表的大小不同。是否尝试向选择输入添加宽度属性?或者检查样式是否覆盖输入宽度?我在select2站点上看到的所有内容都显示了元素本身的宽度(可能是通过js设置的),但所有内容都应用于下拉框,而不是上面的部分。我甚至不能在我的控制台中选择这个元素,这很奇怪。我最终编辑了css以强制使用.select2容器宽度。这似乎奏效了。我不知道为什么会发生这种情况。我一开始也有同样的pb。css编辑不是必需的,我只是使用了给定的三个参数。你试过这个吗?我很好奇。是的,但是100%的宽度太大了。但是它没有工作。哦,嗯,我使用twitter引导,所以我已经处于浮动范围。我确定了跨度的大小,然后宽度=100。