Having some trouble with angular-ui bootstrap: I am using 2 input elements:
<input type="text" ng-model="selected" uib-typeahead="state for state in states | filter:$viewValue | limitTo:8" typeahead-on-select="focusSuccessive($item, $model, $label, $event)" class="form-control">
<textarea class="form-control" id="message" rows="10" data-ng-model="caller.data.text" tabindex="25"></textarea>
In my controller, there is a function called focusSuccessive($item, $model, $label, $event) that should focus on the textarea after selection.
$scope.focusSuccessive = function($item, $model, $label, $event){
angular.element("#message").focus();
}
This approach doesn't seem to be working properly. However, if I use a button like this:
<button ng-click="focusSuccessive()">focus</button>
It does work. Can anyone suggest a way to focus on a textarea or input after a typeahead selection?