bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Datepicker and ngAnimate (Angular 1.3.X)

Open lgaudez opened this issue 11 years ago • 25 comments

This bug is present with angular version 1.3.X and ui-bootstrap 0.13.1.

Some log are thrown : "TypeError: Cannot read property 'parentNode' of undefined at angular-animate.js:1203 at angular-animate.js:539 at Scope.$get.Scope.$digest (angular.js:14293) at Scope.$get.Scope.$apply (angular.js:14506) at bootstrapApply (angular.js:1448) at Object.invoke (angular.js:4185) at doBootstrap (angular.js:1446) at bootstrap (angular.js:1466) at angularInit (angular.js:1360) at angular.js:26125"

I made a plunker to reproduce (check logs in console). http://plnkr.co/edit/JmRcZgCDyy2tXD7qFW1g?p=preview

I have no time to investigate right now but it can be caused by the recent refactoring of the datepicker (in order to remove some watchers, https://github.com/angular-ui/bootstrap/pull/3770)

This bug is not present with angular 1.4.X

lgaudez avatar Jul 24 '15 10:07 lgaudez

Thank you for isolating this - I will look into this early next week and hope to have a fix released in the next two weeks.

wesleycho avatar Jul 24 '15 16:07 wesleycho

This error appears to disappear in Angular 1.4 as shown here.

A fix for 1.3 is ideal here, although it does not seem to break functionality. This appears to be a bug in Angular itself, but it should be noted that the Angular team has moved on to mainly focus support on 1.4 as the stable release and 1.2 for IE8 support. The bug seems to be related to ngAnimate and the directive replace option, as the error can be observed to be removed if replace: true is removed from datepickerPopupWrap.

It should be noted that we have moved to testing in 1.4 off of master now.

I am not sure whether it is worth patching this, although I do welcome any PRs.

wesleycho avatar Jul 29 '15 05:07 wesleycho

Ok thanks for your investigation. Which release should fully support angular 1.4? Le 29 juil. 2015 7:52 AM, "Wesley Cho" [email protected] a écrit :

This error appears to disappear in Angular 1.4 as shown here http://plnkr.co/edit/m4AsVj4KXjmiSFEoHK3f?p=preview.

A fix for 1.3 is ideal here, although it does not seem to break functionality. This appears to be a bug in Angular itself, but it should be noted that the Angular team has moved on to mainly focus support on 1.4 as the stable release and 1.2 for IE8 support. The bug seems to be related to ngAnimate and the directive replace option, as the error can be observed to be removed if replace: true is removed from datepickerPopupWrap.

It should be noted that we have moved to testing in 1.4 off of master now.

I am not sure whether it is worth patching this, although I do welcome any PRs.

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/bootstrap/issues/4012#issuecomment-125850457 .

lgaudez avatar Jul 29 '15 06:07 lgaudez

I am not able to choose date again when choosed once in the datepicker of ui bootstrap. How to get rid of this problem pls help me.

dlblamit avatar Jul 30 '15 04:07 dlblamit

@lgaudez 1.4 will be fully supported by 0.13.2, which is likely to come out this weekend.

wesleycho avatar Jul 30 '15 04:07 wesleycho

Ok perfect, i'll wait for 0.13.2. You can close this issue. Thanks Le 30 juil. 2015 6:55 AM, "Wesley Cho" [email protected] a écrit :

@lgaudez https://github.com/lgaudez 1.4 will be fully supported by 0.13.2, which is likely to come out this weekend.

— Reply to this email directly or view it on GitHub https://github.com/angular-ui/bootstrap/issues/4012#issuecomment-126183061 .

lgaudez avatar Jul 30 '15 06:07 lgaudez

I am still seeing this issue in the new version

codeorganic avatar Aug 03 '15 18:08 codeorganic

I'm still seeing the issue persist even after reinstalling whole bower packages, I'm using it with Angular 1.3.17

elishaterada avatar Aug 03 '15 19:08 elishaterada

I've updated example provided by @lgaudez with latest script versions http://plnkr.co/edit/OYgnLKiAHa640JKq2YGV?p=preview

elishaterada avatar Aug 03 '15 21:08 elishaterada

I hope you're not suing it, but using it :) .

I will look into this - as far as I remember, it wasn't causing any breaking functionality though.

wesleycho avatar Aug 03 '15 21:08 wesleycho

Haha! Yes, I'me aware that it's not breaking functionality but does get in a way of consoles and does not look nice to show errors while reviewing apps with clients devs.

elishaterada avatar Aug 03 '15 22:08 elishaterada

It's definitely fair, I shouldn't have closed the issue and scheduled this more appropriately - that was laziness on my part, and it was good that it was pointed out.

wesleycho avatar Aug 03 '15 22:08 wesleycho

Looking into this further, I suspect this may be an issue in ngAnimate itself - I have created an issue https://github.com/angular/angular.js/issues/12503 for reference.

wesleycho avatar Aug 05 '15 06:08 wesleycho

Thanks for the update, the issue only happens when I use datepicker but not other ui directives with ngAnimate. So somehow the combination of two are causing the issue.

elishaterada avatar Aug 05 '15 21:08 elishaterada

I also see this issue only with datepicker.

PavelKonon avatar Aug 07 '15 07:08 PavelKonon

Ya it is something directly related to ui.bootstrap @wesleycho and not angular.

Please look at: http://plnkr.co/edit/MnBZ2rJfz7uw0u6bVbLo?p=preview

In the above link ui.bootstrap does not have this issue for version 0.13.0. This issue is only present in 0.13.1 and 0.13.2 of ui.bootstrap.

codeorganic avatar Aug 07 '15 07:08 codeorganic

Having same issue. My temporary fix is to wrap my overridden template template/datepicker/popup.html with additional <div>...</div>

moonboyio avatar Aug 07 '15 10:08 moonboyio

@codeorganic the datepicker does not use ngAnimate for anything - the stack trace of the errors are also sole with ngAnimate. That explanation is not the proper way to evaluate where the bug lies.

wesleycho avatar Aug 07 '15 13:08 wesleycho

@wesleycho okay sounds good

@moonboyio Do you have a working plnkr.co with your fix?

codeorganic avatar Aug 07 '15 21:08 codeorganic

@wesleycho

This is a simple example: http://plnkr.co/edit/iaZGS6mYvMiJY5pu19Ig?p=preview See additional div wrapper in a template.

moonboyio avatar Aug 10 '15 14:08 moonboyio