sveltejs/sapper

Anchor tag with target attribute breaks Sapper seamless page navigation

Closed this issue · 1 comments

Describe the bug
Having the attribute and value of target="_self" breaks Sapper seamless page navigation and causes the browser to reload and then navigate to the page.

target="_self" is supposed to be the default value either way, but explicitly setting it in the links seems to break it.

To Reproduce

  1. Any Sapper app would do
  2. Add target="_self" to any anchor tag
  3. Clicking that link would cause the browser to refresh and load

Expected behavior
Expected having target wouldn't affect site navigation

Information about your Sapper Installation:

  System:
    OS: Windows 10 10.0.19041
  Binaries:
    Node: 14.8.0
    npm: 6.14.8
  Browsers:
    Edge: Chromium (85.0.564.51)
  npmPackages:
    rollup: ^2.26.11 => 2.26.11
    sapper: 0.28.7 => 0.28.7
    svelte: ^3.25.1 => 3.25.1

Occurs in both run dev and exported app

Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Sapper entirely?

Trivial, but worth to keep in mind

This is by design - using target="_self" to indicate that this link should be treated normally is a fairly standard idiom in click-interception SPAs.