Skip to content

<title> doesn't reset on navigation #10124

Closed as not planned
Closed as not planned
@UnlimitedBytes

Description

@UnlimitedBytes

Describe the bug

When you have an svelte application which set's the title of the page on any route, while not setting the title of the page on other routes. The routes will keep the title of the previous route. This is not standard browser behavior and can easily confuse users. Instead svelte should remove the <title> tag from the page to not confuse users.

Reproduction

A repository containing the code to reproduce: https://github.com/UnlimitedBytes/sveltekit-csr-title-bug
You will need to change the let defaultLink = false; inside src\routes\+layout.svelte to see the different behavior between default browser routing and svelte routing. A value of true will use default browser routing while a value of false will use svelte's routing.

A hosted version of the above repository can be found here: https://svelte-csr-title-issue.surge.sh/
Because we can't change the let defaultLink value on this website I rendered both versions of the application statically and moved them to the following subfolders:

Logs

Not needed

System Info

Not needed

Severity

serious, but I can work around it

Additional Information

Not needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions