-
Notifications
You must be signed in to change notification settings - Fork 33
href="#" changed in output #238
Comments
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd Is this inside of a polymer app? What is outputting the HTML? Added NeedsInfo label. |
<img src="https://avatars.githubusercontent.com/u/3472245?v=3" align="left" width="48" height="48"hspace="10"> Comment by markhats 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". |
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd Thanks for the additional info. Does this happen with a straight JavaScript polymer app? Added Pkg-Polymer, Area-Pkg, Triaged labels. |
<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch 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. |
<img src="https://avatars.githubusercontent.com/u/3472245?v=3" align="left" width="48" height="48"hspace="10"> Comment by markhats I'm using polymer 0.11.0+5. I haven't tried it in a straight JavaScript polymer app. |
<img src="https://avatars.githubusercontent.com/u/3472245?v=3" align="left" width="48" height="48"hspace="10"> Comment by markhats 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. |
<img src="https://avatars.githubusercontent.com/u/984921?v=3" align="left" width="48" height="48"hspace="10"> Comment by jakemac53 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. |
<img src="https://avatars.githubusercontent.com/u/984921?v=3" align="left" width="48" height="48"hspace="10"> Comment by 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. |
<img src="https://avatars.githubusercontent.com/u/984921?v=3" align="left" width="48" height="48"hspace="10"> Comment by jakemac53 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. |
<img src="https://avatars.githubusercontent.com/u/984921?v=3" align="left" width="48" height="48"hspace="10"> Comment by jakemac53 See http://www.polymer-project.org/docs/polymer/databinding-compat.html#binding-to-attributes for more info about _href. |
<img src="https://avatars.githubusercontent.com/u/3472245?v=3" align="left" width="48" height="48"hspace="10"> Comment by markhats Great, the _href="{{'#'}}" trick works for now. Thanks. |
<img src="https://avatars.githubusercontent.com/u/3472245?v=3" align="left" width="96" height="96"hspace="10"> Issue by markhats
Originally opened as dart-lang/sdk#20034
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: