angular-ui / bootstrap

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!
http://angular-ui.github.io/bootstrap/
MIT License
14.3k stars 6.74k forks source link

Elements created using ng-Repeat in datepicker have the wrong parent hierarchy #6650

Closed silvl closed 6 years ago

silvl commented 6 years ago

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

icfantv commented 6 years ago

closing this as this project is no longer being maintained, per the README and the ISSUE_TEMPLATE.