Skip to content
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

Closed
markhats opened this issue Jul 14, 2014 · 12 comments
Closed

href="#" changed in output #20034

markhats opened this issue Jul 14, 2014 · 12 comments
Assignees
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.

Comments

@markhats
Copy link

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>

@sethladd
Copy link
Contributor

Is this inside of a polymer app?

What is outputting the HTML?


Added NeedsInfo label.

@markhats
Copy link
Author

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".

@sethladd
Copy link
Contributor

Thanks for the additional info.

Does this happen with a straight JavaScript polymer app?


Added Pkg-Polymer, Area-Pkg, Triaged labels.

@sigmundch
Copy link
Member

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.
Added Priority-Medium, PolymerMilestone-Next labels.

@markhats
Copy link
Author

I'm using polymer 0.11.0+5.

I haven't tried it in a straight JavaScript polymer app.

@markhats
Copy link
Author

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.

@jakemac53
Copy link
Contributor

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.
Added Started label.

@jakemac53
Copy link
Contributor

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.

@jakemac53
Copy link
Contributor

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.

@jakemac53
Copy link
Contributor

@markhats
Copy link
Author

markhats commented Aug 1, 2014

Great, the _href="{{'#'}}" trick works for now.

Thanks.

@markhats markhats added Type-Defect area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. labels Aug 1, 2014
@DartBot
Copy link

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#238.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams.
Projects
None yet
Development

No branches or pull requests

5 participants