diff --git a/src/directive.ts b/src/directive.ts index 702bcaa..d240b57 100644 --- a/src/directive.ts +++ b/src/directive.ts @@ -409,7 +409,9 @@ export default class Directive implements ng.IDirective { $scope.input .on('focus click', () => $scope.$evalAsync($scope.view.open)) .on('blur', () => $scope.$evalAsync($scope.view.close)) - .on('keydown', (e) => $scope.keyboard && $scope.$evalAsync(() => $scope.view.keydown(e))); + .on('keydown', (e) => { + if ($scope.keyboard) $scope.$evalAsync(() => $scope.view.keydown(e)) + }); $scope.contents.on('click', () => focusInput()); $scope.container.on('mousedown', (e: JQueryEventObject) => focusInput(e)); angular.element(this.$window).on('resize scroll', $scope.view.position);