This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Broken anchor link when directive replaces its markup #4262
Milestone
Comments
the first link is not clickable because we call preventDefault() when click occurs: angular.js/src/ng/directive/a.js Line 43 in b1ee538
this is because the original anchor didn't have any I suppose that we could prevent default only if the href is missing when a click occurs. |
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 23, 2015
Previously, when an `a` tag element used a directive with a replacing template, and did not include an `href` or `name` attribute before linkage, the anchor directive would always prevent default. Now, the anchor directive will cancel its event listener if the linked element is not the same as the target element of the event. Closes angular#4262
the cause of this is that event listeners are copied, and the replacement |
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 23, 2015
Previously, when an `a` tag element used a directive with a replacing template, and did not include an `href` or `name` attribute before linkage, the anchor directive would always prevent default. Now, the anchor directive will cancel its event listener if the linked element is not the same as the target element of the event. Closes angular#4262
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 23, 2015
Previously, when an `a` tag element used a directive with a replacing template, and did not include an `href` or `name` attribute before linkage, the anchor directive would always prevent default. Now, the anchor directive will cancel its event listener if the linked element is not the same as the target element of the event. Closes angular#4262
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Jan 23, 2015
Previously, when an `a` tag element used a directive with a replacing template, and did not include an `href` or `name` attribute before linkage, the anchor directive would always prevent default. Now, the anchor directive will cancel its event listener if the linked element is not the same as the target element of the event. Closes angular#4262
caitp
added a commit
that referenced
this issue
Jan 23, 2015
…e event if target is different element Previously, when an `a` tag element used a directive with a replacing template, and did not include an `href` or `name` attribute before linkage, the anchor directive would always prevent default. Now, the anchor directive will not register an event listener at all if the original directive is replaced with a non-anchor, and will ignore events which do not target the linked element. Closes #4262 Closes #10849
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
A simple directive that replaces markup with an anchor surrounded by a div. This is broken when the markup being replaced is an anchor itself.
There are 2 workarounds:
See here for a reproduction of the issue: http://plnkr.co/edit/sYqXhe3gcBicmR1tSECN
The text was updated successfully, but these errors were encountered: