我想触发下拉焦点输入场开阔。 但它openes突然关闭每次我集中时间。 随着按钮切换一切正常。 下面是例子: http://codepen.io/piernik/pen/ByKRwE
这里是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>
和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;
};