2014-11-05 34 views
4

我正在使用angular ui-select指令,並嘗試使用禁用ng選項禁用它。角度ui-select中的ng-disabled選項縮小文本框

<ui-select multiple ng-model="address.selected" 
      theme="bootstrap" 
      ng-disabled="true" 
      reset-search-input="true" 
      style="width: 300px;"> 

這裏是plunker http://plnkr.co/edit/julETCG4zCGAxFJ0PSBF?p=preview

文本框的大小與NG-禁用= 「真正的」 收縮。

+0

您的plunkr在控制檯中有錯誤,導致它無法運行。 – Blazemonger 2014-11-05 21:25:55

回答

4

更新theme如下面所示的bootstrapselect2

<ui-select multiple ng-model="address.selected" 
     theme="select2" 
     ng-disabled="true" 
     reset-search-input="true" 
     style="width: 300px;"> 

如果你想bootstrap主題再加入這個而不是風格:

.ui-select-multiple.ui-select-bootstrap { 
    min-height: 34px;   
    height: auto; 
    padding: .3em; 
} 

如圖所示here

+0

它適用於select2主題,但我想要bootstarp主題。 – swe 2014-11-05 21:38:34

+1

查看我的更新回答。 @swe – dmahapatro 2014-11-05 21:52:41

+0

謝謝!它的工作 – swe 2014-11-05 21:59:12