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

本文介绍了如何通过修改CSS样式来优化UI-Select组件的显示效果,包括调整输入框位置及最小高度等,确保与form-control元素保持一致的高度。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

.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

参考这个得到的灵感


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值