From ade450cf5b56479a4c267a50afc1468d62ebc282 Mon Sep 17 00:00:00 2001 From: Indri Muska Date: Sun, 9 Apr 2017 23:08:41 +0200 Subject: [PATCH] Fix return fall on keydown Ref. #158 --- src/directive.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);