I am using angular (Version 1.3.9) and angular-ui/typeahead from http://angular-ui.github.io/bootstrap/ (Version 0.12.0).
In my web app the user should be forced to chose one of the options offered by the typeahead/autocomplete dropdown, so I set <input typeahead="..." typeahead-editable="false" .../>.
The problem is, that when the user clicks the mouse button and holds it pressed, the validation already kicks in, but the model doesn't get updated with the selected option yet. The selection is fired when the user releases the mouse button. So in the timeframe between clicking and releasing the mouse button the element's state gets invalid and therefore my corresponding error message is displayed.
This timeframe normally is less than a second (depending on how fast the user releases the mouse button). But still it is a very bad user experience if the error shows up in this little timeframe.
Can I change the order of execution of the corresponding directives? E.g. ng-select should be called before ng-blur?
Which options do you know to solve the problem?
You can test the behavior on http://co2offset.atmosfair.de/flight/offset Just type in an airport, select an option from the dropdown list and hold the mouse button pressed. Then you see the red error message which you shouldn't see.
form.$error.<directive>[0].$touched && form.$error.<directive>[0].$invalid.