I am attempting to focus on an input type text after selecting an option from a select box. However, after selecting the option, the focus switches back to the select box instead of staying on the input.
To see the issue in action, here is a link to a JSFiddle.
Below is the code snippet:
<div ng-controller="MyCtrl" layout layout-align="center center">
<md-select ng-model="myModel" placeholder="Pick" ng-change="onChange()" md-on-open="onOpen()">
<md-option value="0">Zero</md-option>
<md-option value="1">One</md-option>
</md-select>
<input type="text" id="fc">
</div>
<script>
angular.module('MyApp', ['ngMaterial'])
.controller('MyCtrl', function ($scope) {
$scope.onChange = function() {
document.getElementById('fc').focus();
};
$scope.onOpen = function() {
document.getElementById('fc').focus();
};
})
</script>