-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
href="#" changed in output #20034
Comments
Is this inside of a polymer app? What is outputting the HTML? Added NeedsInfo label. |
Yes, this is a Polymer app. I'm talking about the output html that is produced when clicking "Run in Dartium" or "Run as Javascript". |
Thanks for the additional info. Does this happen with a straight JavaScript polymer app? Added Pkg-Polymer, Area-Pkg, Triaged labels. |
My guess this is something that happens in our build process ("run in dartium" today is using pub serve and is running our transformers). Which version of polymer are you using? We made some recent changes in our transformers that could affect this too. Removed Priority-Unassigned label. |
I'm using polymer 0.11.0+5. I haven't tried it in a straight JavaScript polymer app. |
Is there any workaround for this issue at the moment? It's quite frustrating as it renders my app pretty unusable unless I take all occurrences of href="#" out. |
This does not appear to be a result of the build process as originally anticipated, if you view the source the href is correct. This also only happens for link tags inside of polymer elements template, and the # gets removed both inside the template and in the resulting usages of the element. I tested with just a normal template and it wasn't happening. Set owner to @jakemac53. |
After further testing, this is happening in Polymer js so we probably need to wait for it to get fixed on their end, I have submitted Polymer/polymer#672 to them to track it. Added MovedToGithub label. |
I did find one hack you can use as a workaround, if you use a binding that just outputs the hashtag as a string that seems to work. You should use the _href version in this case as well to maintain browser support: <a _href="{{'#'}}">test</a> It isn't beautiful, but it should unblock you. |
See http://www.polymer-project.org/docs/polymer/databinding-compat.html#binding-to-attributes for more info about _href. |
Great, the _href="{{'#'}}" trick works for now. Thanks. |
This issue has been moved to dart-archive/polymer-dart#238. |
When href="#" is specified on an anchor element, it gets changed to simply href="" in the output html. This causes a page reload when clicking on the element rather than allowing the element to look like a hyperlink but actually go nowhere.
e.g
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Temp</a>
becomes:
<a href="" class="dropdown-toggle" data-toggle="dropdown">Temp</a>
The text was updated successfully, but these errors were encountered: