You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is impossible to detect when a typeahead is valid (meaning that an item as been selected or match one of the list - and not just a random input). The input becomes valid whenever something is inserted. I'm using a model driven approach to forms.
Angular: 2.0.0
ng-bootstrap: 1.0.0-alpha.5
Bootstrap: 4-alpha 4
The text was updated successfully, but these errors were encountered:
IMO there is a limited set of validation rules when it comes typeaheads - required is probably the most common one (I'm saying this since the whole idea of a typeahead is to present users with a set of valid matches - there is no point of presenting for selection an option that is invalid).
As of today a field that has a typeahead on it is editable by default (by "editable" I mean that whatever a user types in the input field gets propagated to the model). So in this sense as soon as a user starts typing something the field is "valid" (when it comes to the required validator rule).
What you are really looking for is the equivalent of the typeahead-editable option from http://angular-ui.github.io/bootstrap/#/typeahead. by switching on this option you could enforce a rule bu which users can only select an entry from the autcomplete. No selection = no model update => field not valid (from the "required") point of view.
@natcohen does the above make sense? Of so I'm going to rename this issue. BTW, we are planning to add editable option anyway.
It is impossible to detect when a typeahead is valid (meaning that an item as been selected or match one of the list - and not just a random input). The input becomes valid whenever something is inserted. I'm using a model driven approach to forms.
Angular: 2.0.0
ng-bootstrap: 1.0.0-alpha.5
Bootstrap: 4-alpha 4
The text was updated successfully, but these errors were encountered: