Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Update animate.js #9636

Closed
wants to merge 1 commit into from
Closed

Update animate.js #9636

wants to merge 1 commit into from

Conversation

wilgert
Copy link

@wilgert wilgert commented Oct 15, 2014

Check if cache and cache.classes exist. Sometimes cache is undefined and errors are thrown when looped over.

Check if cache and cache.classes exist. Sometimes cache is undefined and errors are thrown when looped over.
@mary-poppins
Copy link

I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let us know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@wilgert
Copy link
Author

wilgert commented Oct 15, 2014

Just signed it!

@IgorMinar
Copy link
Contributor

do you know when this happens? can you add a test so that we avoid error in future refactorings?

@caitp
Copy link
Contributor

caitp commented Oct 16, 2014

the patch has a lot of whitespace changes which we probably don't want --- I don't think we need a check for cache.classes because forEach() will skip it if it's undefined.

This looks right, though.

@caitp
Copy link
Contributor

caitp commented Oct 16, 2014

667183a#commitcomment-8122956 should explain why the cache / classes might disappear, so that's probably what you want to test

@mary-poppins
Copy link

CLA signature verified! Thank you!

Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes).

vmlf01 added a commit to vmlf01/angular-strap that referenced this pull request Oct 17, 2014
timepicker's auto-close test is failing with angularjs 1.3 release. Looks like the error might be solved once angular merges pull request angular/angular.js#9636, which introduces a check to avoid the exception.
Anyway, the close on blur test works, so something else is triggering the error. By calling the $timepicker.hide method inside a $timeout when auto-closing, the error goes away, so this seems a good fix.
vmlf01 added a commit to vmlf01/angular-strap that referenced this pull request Oct 17, 2014
timepicker's auto-close test is failing with angularjs 1.3 release. Looks like the error might be solved once angular merges pull request angular/angular.js#9636, which introduces a check to avoid the exception.
Anyway, the close on blur test works, so something else is triggering the error. By calling the $timepicker.hide method inside a $timeout when auto-closing, the error goes away, so this seems a good fix.
mgcrea pushed a commit to mgcrea/angular-strap that referenced this pull request Oct 19, 2014
timepicker's auto-close test is failing with angularjs 1.3 release. Looks like the error might be solved once angular merges pull request angular/angular.js#9636, which introduces a check to avoid the exception.
Anyway, the close on blur test works, so something else is triggering the error. By calling the $timepicker.hide method inside a $timeout when auto-closing, the error goes away, so this seems a good fix.
@ee0pdt
Copy link

ee0pdt commented Oct 30, 2014

Any word on when this will be merged? I'm experiencing the same issue.

@jviotti
Copy link

jviotti commented Oct 30, 2014

I'm facing the same issue too. Is there a workaround?

@caitp
Copy link
Contributor

caitp commented Oct 30, 2014

@matsko do you want to just merge this? I thought we already merged a similar fix to this, but I guess not

@caitp
Copy link
Contributor

caitp commented Oct 30, 2014

@jviotti could you provide a repro so that I can write a test case to get this landed? I think the case where this is a bug is when the element gets removed during an animation, but I can't remember.

@caitp caitp mentioned this pull request Oct 30, 2014
@jviotti
Copy link

jviotti commented Oct 30, 2014

@caitp Sadly I'm unable to reproduce. The issue happens very weirdly with the presence of a directive on only one of my pages and I still can't find the source of the issue.

The directive uses angular-animate, but the issue doesn't happens in other pages that uses that directive, and even on the same page where there is another instance of that directive.

I'll create a plunker if I manage to reproduce.

@caitp
Copy link
Contributor

caitp commented Oct 30, 2014

hmm.. there are definitely cases where data is gone... thinking :c maybe ng-if issue

@caitp
Copy link
Contributor

caitp commented Oct 30, 2014

I think this bug was actually fixed already by 613d0a3 --- i can't find another way to reproduce it.

@caitp
Copy link
Contributor

caitp commented Oct 30, 2014

yeah I'm just going to close this for now because as far as I can tell, it's fixed.

@ee0pdt
Copy link

ee0pdt commented Oct 30, 2014

Can I clarify in which version this fix is applied? I'm running 1.3.0 and still have issues

In my case it happens with nested ng-repeats when I remove the parent

@jdiver
Copy link

jdiver commented Oct 30, 2014

This is definitely still an issue as of 1.3.0. I can try to come up with a plunkr to reproduce it. Here is a trace:

TypeError: Cannot read property 'classes' of undefined
    at resolveElementClasses
    at Scope.$digest
    at Scope.$apply
    at completeOutstandingRequest

(anonymous function)
(anonymous function)
Scope.$digest
Scope.$apply
(anonymous function)
completeOutstandingRequest
(anonymous function)

cache is undefined at this line within the resolveElementClasses method of the ngAnimate module:

forEach(cache.classes, function(status, className) {

@caitp
Copy link
Contributor

caitp commented Oct 30, 2014

please do try to come up with a way to reproduce it

@matsko
Copy link
Contributor

matsko commented Oct 30, 2014

Are you guys perhaps trying to do addClass/removeClass on an element that has no parent?

@caitp
Copy link
Contributor

caitp commented Oct 30, 2014

I wasn't able to make it work whether there was a parent or not. even using jqLite#removeData() didn't change it.

@ee0pdt
Copy link

ee0pdt commented Oct 31, 2014

I've been trying to recreate it in Plunker but no luck. I've checked my versions again and even swapped out my versions of angular.js and angular-animate.js to latest version and still have the issue.

TypeError: Cannot read property 'classes' of undefined
    at resolveElementClasses (http://localhost:8000/vendor/angular-animate/angular-animate.js:549:22)
    at http://localhost:8000/vendor/angular-animate/angular-animate.js:1188:27
    at http://localhost:8000/vendor/angular-animate/angular-animate.js:514:22
    at Scope.$get.Scope.$digest (http://localhost:8000/vendor/angular/angular.js:14015:36)
    at Scope.$get.Scope.$apply (http://localhost:8000/vendor/angular/angular.js:14227:24)
    at HTMLAnchorElement.<anonymous> (http://localhost:8000/vendor/angular-touch/angular-touch.min.js:11:383)
    at HTMLAnchorElement.jQuery.event.dispatch (http://localhost:8000/vendor/jquery/dist/jquery.js:4409:9)
    at HTMLAnchorElement.jQuery.event.add.elemData.handle (http://localhost:8000/vendor/jquery/dist/jquery.js:4095:28) angular.js:11358(anonymous function) angular.js:11358$get angular.js:8445$get.Scope.$digest angular.js:14017$get.Scope.$apply angular.js:14227(anonymous function) angular-touch.js:440jQuery.event.dispatch jquery.js:4409jQuery.event.add.elemData.handle

@ryasmi ryasmi mentioned this pull request Oct 31, 2014
matsko pushed a commit that referenced this pull request Oct 31, 2014
@ChrisBellew
Copy link

Thanks @matsko! I was worried about this all weekend. You saved the sprint! :)

@jviotti
Copy link

jviotti commented Nov 3, 2014

In which version will this fix land?

@jdiver
Copy link

jdiver commented Nov 3, 2014

I can confirm that this issue is fixed in 1.3.2-build.3514+sha.d906ed3 Thanks!

@jviotti
Copy link

jviotti commented Nov 3, 2014

I can confirm it works too! Thanks a lot!

@matsko
Copy link
Contributor

matsko commented Nov 4, 2014

Good stuff. Thanks everyone.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants