Skip to content

Commit

Permalink
Use anchor .href property only when using browser history
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed May 6, 2024
1 parent a94659e commit 98b01a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nasty-paws-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chialab/synapse": patch
---

Use anchor .href property only when using browser history.
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, listen, observe, property, state } from '@chialab/dna';
import { Page } from './Components/Page';
import { BrowserHistory } from './Router/BrowserHistory';
import { History, NavigationDirection } from './Router/History';
import type { Middleware } from './Router/Middleware';
import type { RequestInit, RequestMethod } from './Router/Request';
Expand Down Expand Up @@ -271,7 +272,7 @@ export class App extends Component {
throw new Error('Application has not started yet');
}

const href = node.href;
const href = this.history instanceof BrowserHistory ? node.href : node.getAttribute('href');
if (!href) {
return;
}
Expand Down

0 comments on commit 98b01a1

Please sign in to comment.