app-route icon indicating copy to clipboard operation
app-route copied to clipboard

Hash as path intercepts links to paths without hash

Open romanl-g opened this issue 9 years ago • 2 comments

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

  • [x] Chrome
  • [ ] Firefox
  • [ ] Safari 9
  • [ ] Safari 8
  • [ ] Safari 7
  • [ ] Edge
  • [ ] IE 11
  • [ ] IE 10

romanl-g avatar May 12 '16 20:05 romanl-g

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"

rictic avatar May 12 '16 23:05 rictic

+1 - Ran into this today.

kbenjamin avatar Jul 21 '16 22:07 kbenjamin