-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui-sref inside inlcuded svg stopped to work since 0.2.11 #1667
Comments
martinoss
added a commit
to martinoss/ui-router
that referenced
this issue
Jan 3, 2015
Fix the tagName comparism to make ui-sref also work inside an SVG.
martinoss
added a commit
to martinoss/ui-router
that referenced
this issue
Jan 3, 2015
This reverts commit 43cf25b.
martinoss
added a commit
to martinoss/ui-router
that referenced
this issue
Jan 3, 2015
Fix the tagName comparism to make ui-sref also work inside an SVG.
martinoss
added a commit
to martinoss/ui-router
that referenced
this issue
Jan 3, 2015
…ar-ui#1667 Set the correct attribute when dealing with an SVG anchor element. Otherwise, angular will prevent the click.
martinoss
added a commit
to martinoss/ui-router
that referenced
this issue
Jan 5, 2015
nateabele
added a commit
that referenced
this issue
Jan 6, 2015
fix($StateRefDirective): resolve support for svg anchor elements #1667
Looks good. Feel free to submit those commits as a PR and I'll get them merged, thanks. |
See this PR #1668, thanks for merging. |
Thanks for the fix. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I included an SVG image with some links (ui-sref) in my project using ng-include.
After I upgraged from 0.2.10 to 0.2.13, the links are no more getting invoked. It turned out that it's broken since 0.2.11.
Here is an example:
http://plnkr.co/edit/uod9jpkySgYsXya66v51?p=preview
If you change the included ui-router script to 0.2.11 or 0.2.13, clicking the svg has no effect.
The issue should be easy to fix:
In the directie $StateRefDirective there is a check if the element is an anchor element:
isAnchor = element.prop("tagName") === "A";
In case of the SVG, the tag name was lowercase ("a").
isAnchor = element.prop("tagName").toUpperCase() === "A";
will to the trick.The text was updated successfully, but these errors were encountered: