I want to trigger dropdown open on focus on input field. But it openes and suddenly closes every time I focus. With button toggle everything is ok. Here is example: http://codepen.io/piernik/pen/ByKRwE
Here is HTML
<div class="input-group">
<input type="text" class="form-control" ng-focus="show($event)">
<div class="input-group-addon"><i class="fa fa-fw fa-calendar"></i></div>
</div>
<a class="btn btn-default" ng-click="toggleDropdown($event)">toggle</a>
<div class="dropdown" dropdown is-open="model.open">
<ul class="dropdown-menu" role="menu">
Content
</ul>
</div>
And JS:
$scope.model = {
open: false
};
$scope.toggleDropdown = function ($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.model.open = !$scope.model.open;
};
$scope.show = function ($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.model.open = true;
};
$scope.hide = function ($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.model.open = false;
};