Skip to content

Commit

Permalink
fix(linked-item): handle rootURLs and hash locations
Browse files Browse the repository at this point in the history
  • Loading branch information
anehx committed Jan 25, 2022
1 parent 4a0f808 commit 0ffe74f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion addon/components/-private/linked-list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ export default class LinkedListItemComponent extends Component {
get route() {
if (!this.href) return null;

const routeInfo = this.router.recognize(this.href);
let href = this.href;

/* istanbul ignore next */
if (this.router.location.implementation === "hash") {
href = href.replace(/^#/, "");
}

/* istanbul ignore next */
if (!href.startsWith(this.router.rootURL)) {
href = `${this.router.rootURL}${href}`;
}

const routeInfo = this.router.recognize(href);

if (!routeInfo) return null;

Expand Down

0 comments on commit 0ffe74f

Please sign in to comment.