I have a problem with angular-ui bootstrap: I have 2 input:
<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>
And in my controller I have a function focusSuccessive($item, $model, $label, $event)" that should focus textArea after selected.
$scope.focusSuccessive = function($item, $model, $label, $event){
angular.element("#message").focus();
}
But it doesn't work, But if I put a button like:
<button ng-click="focusSuccessive()">focus</button>
It work, so How Can I focus a textarea or input after typeahead selected?