angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

1.1.5 breaks ngClick when used in combination with ngAnimate and ngShow

Open jasadams opened this issue 13 years ago • 5 comments

There is a bug introduced in 1.1.5 when you have a html element set up with directives like the following.

<button ng-show="showButton"
        ng-click="setText('with animate')" 
        ng-animate="{show: 'fade-show', hide: 'fade-hide'}">
          With Animate
</button>

The animation works fine, but the ngClick directive stops working once the element has been hidden by the ngShow directive. Here is the plunkr using 1.1.5 demonstrating the issue. Here is the plunkr using 1.1.4 showing that the bug doesn't exist

jasadams avatar Jun 04 '13 17:06 jasadams

Indeed. Same problem here.

rafaelwmartins avatar Jun 07 '13 02:06 rafaelwmartins

Ran into this too. For my case I was able to work around it by putting the ng-click on a dummy enclosing element.

mikaraento avatar Jun 19 '13 10:06 mikaraento

I think this effects ng-animate with other directives as well. I've tested ng-repeat, ng-if and ng-show and they all have the issue. See issue #2566

smdvdsn avatar Jul 08 '13 21:07 smdvdsn

@matsko & @mhevery - this seems like a valid and quite serious regression.

petebacondarwin avatar Jul 09 '13 11:07 petebacondarwin

This has been fixed in master: e1a050e6b26aca4d0e6e7125d3f6c1c8fc1d92cb ngAnimate was calling element.removeData() but there was a bug in the jqLite version that caused it to unbind all the events on that element. You can see that is works if you use jQuery rather than jqLite here: http://plnkr.co/edit/pRfeFf2vFdtjuZ8TvkQO?p=preview And you can see that it is now working if you use a recent build on master: http://plnkr.co/edit/GKsaVhKaLWCF9o6Hyofq?p=preview

petebacondarwin avatar Jul 09 '13 11:07 petebacondarwin