-
Notifications
You must be signed in to change notification settings - Fork 27.4k
htmlAnchorDirective click event stop bubbling... #1651
Comments
I experienced the same problem with some Bootstrap dropdowns not closing when clicked and no href was specified for the list items. Removing the "return false" fixes it. |
I found another error (I think), the
I should open a new issue? Thanks! |
Don't think so, maybe this answers your question: http://onehungrymind.com/quick-note-ng-disabled-and-anchor-tags-oh-noes/ Does it behave the same way when using Angular 1.0.2 ? |
@Letsan jajajaja thanks. This was funny :p I've begin using AngularJS since yesterday with 1.0.3, I suppose will behave the same. |
Actually it does behave the same in 1.0.2 this behaviour seems expected. |
This is caused by c81d817. Quick fix: comment out "return false". |
fixed by 14948cf |
This reverts commit c81d817. This commit causes several issues (angular#1651, angular#1674, angular#1662) and doesn't even contain a test that proves that anything on Opera got actually fixed. If the original Opera resurfaces, we'll fix it properly.
May be below code will help you if(element.prop("tagName") == 'A'){ |
Hi, I just upgraded my angular.js from 1.0.2 to 1.0.3, and having an issue with this fix after the upgrade.
Since my app has some elements listen to event delegation from JQuery.
1.0.2
http://plnkr.co/edit/iSem7DYn3b3ERgpD2LTu?p=preview
1.0.3
http://plnkr.co/edit/1SR7IAwrxDmHcE553ylI?p=preview
However, it doesn't work anymore, as the "a" element (htmlAnchorDirective) "click" event now stop bubbling up...
I just looking at the JQuery Doc, it seems "event.preventDefault()" and "return false" should be doing different things.
http://api.jquery.com/bind/
Example: Cancel a default action and prevent it from bubbling up by returning false:
$("form").bind("submit", function() { return false; })
Example: Cancel only the default action by using the .preventDefault() method.
$("form").bind("submit", function(event) { event.preventDefault(); });
Sorry for my bad english...
The text was updated successfully, but these errors were encountered: