From 9b2f7ac315e4ec572e82a7265672cd16b0d99ad4 Mon Sep 17 00:00:00 2001 From: Wesley Cho Date: Mon, 31 Aug 2015 14:11:17 -0700 Subject: [PATCH] fix(datepicker): ensure the original target is not in popup - Ensure that the original event target is not a child of the popup element to avoid edge case where the datepicker closes on any click Closes #4316 Fixes #4314 --- src/datepicker/datepicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datepicker/datepicker.js b/src/datepicker/datepicker.js index fa318c7e2d..4b0ec332d1 100644 --- a/src/datepicker/datepicker.js +++ b/src/datepicker/datepicker.js @@ -715,7 +715,7 @@ function($compile, $parse, $document, $rootScope, $position, dateFilter, datePar }); var documentClickBind = function(event) { - if (scope.isOpen && !element[0].contains(event.target)) { + if (scope.isOpen && !(element[0].contains(event.target) || popupEl[0].contains(event.target))) { scope.$apply(function() { scope.isOpen = false; });