PolymerElements / app-route

A modular client-side router
https://www.polymer-project.org/1.0/articles/routing.html
146 stars 66 forks source link

Hash as path intercepts links to paths without hash #99

Open romanl-g opened 8 years ago

romanl-g commented 8 years ago

Description

carbon-location with use-hash-as-path matches paths without hash.

<carbon-location route="{{route}}" use-hash-as-path></carbon-location>
<a href="#/view">Hash link</a><br/>
<a href="/link">No-hash link</a>

Expected outcome

I expected it to only match paths with hash with use-hash-as-path.

Workaround: url-space-regex="^#/". Not sure how that will work with query params described in 96.

Actual outcome

Empty data?

Live Demo

http://plnkr.co/edit/Cw6bzwtCmmsjuKqZNu0n?p=preview

Steps to reproduce

See demo.

Browsers Affected

rictic commented 8 years ago

Good point! We could definitely give a better default url space regex for this use case.

We still want to match links to the current page's path but different query params, for example: "?a=b#/foo/bar"

kbenjamin commented 8 years ago

+1 - Ran into this today.