angularjs UI select 多选后页面闪动的解决方案

来源:互联网 发布:js 定义对象属性 编辑:程序博客网 时间:2024/06/05 08:20
.ui-select-multiple.ui-select-bootstrap {    height: auto;    min-height: 34px;   /* padding: 3px 3px 0 3px;*/    padding: 4px 4px 3px 4px;}.ui-select-multiple.ui-select-bootstrap input.ui-select-search {    background-color: transparent !important; /* To prevent double background when disabled */    border: none;    outline: none;    height: 1.666666em;    margin-bottom: 3px;    position: absolute;}


1.在

ui-select-multiple.ui-select-bootstrap input.ui-select-search
下添加 position:absolute;
2.在
ui-select-multiple.ui-select-bootstrap
下添加 min-height:34px;
这个高度的值是根据form-control的高度来确定的

  <div class="row">                            <div  class="col-md-3">                                <label>label名</label><br />                                <input type="text" class="form-control" placeholder="" ng-model="name" required>                            </div>                            <div  class="col-md-8">                                <label>label名</label>                                <ui-select  multiple ng-model="aaa.selected" theme="bootstrap"                                            search-enabled="false" close-on-select="false" ng-disabled="!data ">                                    <ui-select-match placeholder=""> {{$item.name}}</ui-select-match>                                    <ui-select-choices repeat="item in data | filter: $select.search">                                        <div ng-bind-html="item.name | highlight: $select.search"></div>                                    </ui-select-choices>                                </ui-select>                            </div>                        </div>

https://github.com/angular-ui/ui-select/issues/533

参考这个得到的灵感