PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
I need to display a uib-datepicker in a dropdown for various custom directives; i.e., entering of a date/time OR a date range w/ various shortcuts. I need the dropdown to have auto-close="outsideClick". When I open the dropdown and select a date the first time, the dropdown remains open as expected. However, if I then click on another date, the dropdown automatically closes. After this any time the dropdown is opened and a date is clicked, it is automatically closed.
The problem is the check for the dropdownElement[0].contains is failing. It looks like when the ng-repeat data model changes, if you trace the evt.target.parentElement hierarchy, it is no longer contained by the dropdown element.
var dropdownElement = openScope.getDropdownElement();
if (evt && openScope.getAutoClose() === 'outsideClick' &&
dropdownElement && dropdownElement[0].contains(evt.target)) {
return;
}
I need to display a uib-datepicker in a dropdown for various custom directives; i.e., entering of a date/time OR a date range w/ various shortcuts. I need the dropdown to have auto-close="outsideClick". When I open the dropdown and select a date the first time, the dropdown remains open as expected. However, if I then click on another date, the dropdown automatically closes. After this any time the dropdown is opened and a date is clicked, it is automatically closed.
The problem is the check for the dropdownElement[0].contains is failing. It looks like when the ng-repeat data model changes, if you trace the evt.target.parentElement hierarchy, it is no longer contained by the dropdown element.
var dropdownElement = openScope.getDropdownElement(); if (evt && openScope.getAutoClose() === 'outsideClick' && dropdownElement && dropdownElement[0].contains(evt.target)) { return; }
Here is a plunker:
https://plnkr.co/edit/lqpt2UBIP1xkmziQxcV1?p=preview