angular ui-select中的ng-disabled选项会缩小文本框

时间:2021-06-21 19:41:38

I am using angular ui-select directive and trying to disable it with ng-disabled option.

我正在使用angular ui-select指令并尝试使用ng-disabled选项禁用它。

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

Here is the plunker http://plnkr.co/edit/julETCG4zCGAxFJ0PSBF?p=preview

这里是plunker http://plnkr.co/edit/julETCG4zCGAxFJ0PSBF?p=preview

Size of the text box shrinks with ng-disabled="true".

文本框的大小随着ng-disabled =“true”而缩小。

1 个解决方案

#1


4  

Update theme from bootstrap to select2 as shown below:

从bootstrap更新主题到select2,如下所示:

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

If you want bootstrap theme then add this to style instead:

如果你想要bootstrap主题,那么将其添加到样式:

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

as shown here.

如图所示。

#1


4  

Update theme from bootstrap to select2 as shown below:

从bootstrap更新主题到select2,如下所示:

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

If you want bootstrap theme then add this to style instead:

如果你想要bootstrap主题,那么将其添加到样式:

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

as shown here.

如图所示。