Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix(datepicker): ensure the original target is not in popup
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
wesleycho committed Sep 1, 2015
1 parent 3b35349 commit 9b2f7ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datepicker/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 9b2f7ac

Please sign in to comment.