bootstrap
bootstrap copied to clipboard
Feature request: Add setting to enable/disable typeahead
Please add a setting typeahead-enable
analogous to tooltip-enable that allows to enable/disable the typeahead.
We use forms that, depending on the users permissions, can either be normal fields using typeahead or read only fields. When the fields are read only we would like to disable the typeahead.
Currently the only way to achieve this, is using an ng-if
and a copy of the input field without typeahead attributes.
Have you tried ng-disabled ? That's what we're using and it seems to work just fine at disallowing input.
ng-disabled
disables the input. However, in bootstrap, disabled input should be grayed out, it is not for this case. Neither does ng-readonly
gray out the typeahead input.
It's not grey because typeahead applies some inline styles to the inputs, one of them being background-color: transparent;, which override form-control[disabled] from bootstrap.
I can think of some nasty workaround involving !important for the time being until this can be fixed: .form-control[disabled][uib-typeahead] { background-color: #eeeeee !important; }