I was having the same issue whereby I could only open the date picker control once using the button, but it would not open a second time. The problem may be related to a scope issue which might be coming about because the button is not a child of the input HTML element. I was able to get the button to work by changing the data model a little bit. For example, instead of using $scope.isDatePickerOpen
as the model, I changed to $scope.datePicker.isOpen
(and set is-open="datePicker.isOpen"
). Note that the new data model for is-open does not hang directly off of $scope
, but was moved one level deep (off the $scope.datePicker
object). This seems to make the data more “findable”.
The other thing I had to do was change the data model on a timer. For example:
$scope.openDatePicker = function($event) {
$event.preventDefault();
$event.stopPropagation();
$timeout( function(){
$scope.datePicker.isOpen = true;
}, 50);
};
At any rate, your workaround posted above was what gave me the motivation to keep looking for a solution, so thanks!